Skip to content

chore: migrate Homebrew install to appwrite/homebrew-appwrite tap#301

Closed
ChiragAgg5k wants to merge 1 commit intomasterfrom
chore/remove-legacy-homebrew-formula
Closed

chore: migrate Homebrew install to appwrite/homebrew-appwrite tap#301
ChiragAgg5k wants to merge 1 commit intomasterfrom
chore/remove-legacy-homebrew-formula

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

Summary

sdk-for-cli is not a Homebrew tap (Homebrew requires the repo to be named homebrew-<name>), so the Formula/appwrite.rb that's lived here has never actually been installable via brew install. This PR migrates the CLI's Homebrew distribution to the dedicated tap at appwrite/homebrew-appwrite and updates the release workflow accordingly.

What this changes

  • Delete Formula/appwrite.rb. The canonical formula now lives in appwrite/homebrew-appwrite. Nothing else referenced this file.
  • Rewire the publish workflow. The old "Update Homebrew formula checksums" step updated a formula in this repo (which couldn't be consumed). The new flow checks out the tap repo via a dedicated HOMEBREW_TAP_GH_TOKEN secret, rewrites Formula/appwrite.rb in the tap with the freshly-built SHA256s, and opens (or updates) a PR on the tap's default branch.
  • Update install instructions. README now says brew install appwrite/appwrite/appwrite (the fully-qualified <owner>/<tap>/<formula> form), links out to the tap repo, and covers both macOS and Linux.
  • Update self-update + version-check code. lib/constants.ts now exposes HOMEBREW_TAP / HOMEBREW_FORMULA constants; lib/utils.ts (for brew info) and lib/commands/update.ts (for brew upgrade and manual-instruction output) use the fully-qualified reference. This means a future name collision in another tap can never hijack the update path.

Required secret (before the next release)

The new workflow step reads a secret that does not exist yet on this repo:

  • HOMEBREW_TAP_GH_TOKEN — a GitHub token (fine-grained PAT or app installation token) with contents: write + pull-requests: write on appwrite/homebrew-appwrite. Used by the workflow to push the release branch and open the PR.

Related PRs

  • Generator-side source-of-truth: feat(cli): move Homebrew formula to dedicated homebrew-appwrite tap sdk-generator#1459. That PR deletes the Homebrew formula template from the CLI generator, renames the params to homebrewTapOwner / homebrewTapName, and produces the same workflow this PR ships. Once #1459 merges, regenerating sdk-for-cli should be a no-op on this PR's changes.
  • Tap bootstrap: appwrite/homebrew-appwrite has been seeded with the formula (verbatim from this repo's master at v18.2.0), README, LICENSE, and brew test-bot CI. Verified end-to-end — brew install appwrite/appwrite/appwrite installs v18.2.0 and appwrite --version works.

Test plan

  • Manual smoke test: brew install appwrite/appwrite/appwrite installs the formula from the new tap and appwrite --version prints 18.2.0.
  • YAML sanity check: .github/workflows/publish.yml parses cleanly.
  • HOMEBREW_TAP_GH_TOKEN secret added to this repo before the next release.
  • Dry-run of the tap workflow on the next release → verify it opens a PR titled appwrite <tag> on appwrite/homebrew-appwrite with the four updated sha256 values and correct version.

Companion to appwrite/sdk-generator#1459. Drops the stub `Formula/appwrite.rb`
(sdk-for-cli is not a Homebrew tap, so `brew install` never actually worked
against this repo) and rewires the release flow to the dedicated tap at
appwrite/homebrew-appwrite.

- Remove `Formula/appwrite.rb`. The canonical formula now lives in
  appwrite/homebrew-appwrite (generated there on bootstrap).
- Replace the "Update Homebrew formula checksums" step with a tap-PR flow:
  check out appwrite/homebrew-appwrite with a new HOMEBREW_TAP_GH_TOKEN
  secret, recompute SHA256s for the four native binaries, patch the
  formula in place, and open (or update) a PR on the tap.
- README: switch install command to `brew install appwrite/appwrite/appwrite`
  and link out to the tap repo; the section now covers both macOS and Linux.
- lib/constants.ts: add HOMEBREW_TAP + HOMEBREW_FORMULA so self-update and
  `brew info` consistently use the fully-qualified `<tap>/<formula>` form.
- lib/utils.ts, lib/commands/update.ts: use HOMEBREW_FORMULA everywhere
  we previously hardcoded `appwrite`.

Requires the new `HOMEBREW_TAP_GH_TOKEN` secret (fine-grained PAT with
`contents: write` + `pull-requests: write` on appwrite/homebrew-appwrite)
to be added to this repo before the next release.
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 17, 2026

Greptile Summary

This PR correctly migrates Homebrew distribution from a formula file that was never consumable (the repo name sdk-for-cli doesn't satisfy Homebrew's homebrew-<name> requirement) to the dedicated appwrite/homebrew-appwrite tap, and wires up a publish workflow that opens a PR on that tap after every release. The TypeScript changes (constants.ts, utils.ts, update.ts) are minimal and consistent — the fully-qualified appwrite/appwrite/appwrite reference ensures brew info, brew upgrade, and user-facing hints all point at the correct tap without ambiguity.

Confidence Score: 5/5

Safe to merge; the migration is logically sound and end-to-end verified per the test plan.

All findings are P2 style suggestions (unnecessary full-history fetch, force-push review dismissal). No correctness, security, or data-integrity issues were found. The workflow, constants, and TypeScript changes are all internally consistent.

.github/workflows/publish.yml — minor fetch-depth and force-push notes only.

Important Files Changed

Filename Overview
.github/workflows/publish.yml Rewires Homebrew update step: checks out tap repo, updates formula via Ruby, and opens/edits a PR. Logic is sound; minor concern around fetch-depth: 0 and force push overwriting review state on re-runs.
lib/constants.ts Adds HOMEBREW_TAP and HOMEBREW_FORMULA constants; fully-qualified tap reference is correct for Homebrew's owner/tap/formula format.
lib/utils.ts Replaces hardcoded appwrite formula name with HOMEBREW_FORMULA constant; brew info JSON v2 structure is unchanged for tap-qualified formula references.
lib/commands/update.ts Replaces hardcoded 'appwrite' with HOMEBREW_FORMULA/EXECUTABLE_NAME constants throughout upgrade and hint messages; changes are correct and consistent.
Formula/appwrite.rb File deleted; formula migrated to appwrite/homebrew-appwrite tap where it can actually be consumed by Homebrew.
README.md Install command updated to fully-qualified tap reference; Linux added to the Homebrew section; accurate and complete.

Reviews (1): Last reviewed commit: "chore: migrate Homebrew install to appwr..." | Re-trigger Greptile

repository: ${{ env.HOMEBREW_TAP_REPO }}
token: ${{ secrets.HOMEBREW_TAP_GH_TOKEN }}
path: homebrew-tap
fetch-depth: 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 fetch-depth: 0 fetches full history unnecessarily

The tap checkout only needs to create a new branch from the default branch HEAD — full history (fetch-depth: 0) isn't required. fetch-depth: 1 is sufficient and avoids cloning the entire tap repo history on every release.

Suggested change
fetch-depth: 0
fetch-depth: 1

git commit -m "chore: update Homebrew formula for ${RELEASE_TAG}"
git push origin "$TARGET_BRANCH"
git commit -m "${EXECUTABLE_NAME} ${RELEASE_TAG}"
git push -f -u origin "$BRANCH"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Force push dismisses any existing PR reviews

git push -f correctly handles re-runs, but it will also dismiss any "approved" or "changes requested" reviews on an existing open PR in the tap repo. For a fully automated tap this is probably acceptable, but if human reviewers ever approve the formula PR before merging, a re-triggered release would silently reset that approval. Consider adding a note in the workflow or PR body that re-runs will invalidate existing reviews.

@ChiragAgg5k
Copy link
Copy Markdown
Member Author

Closing — the cleanup will flow through the normal generator → release pipeline once appwrite/sdk-generator#1459 merges, so a direct PR here isn't needed.

@ChiragAgg5k ChiragAgg5k deleted the chore/remove-legacy-homebrew-formula branch April 17, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant