chore: migrate Homebrew install to appwrite/homebrew-appwrite tap#301
chore: migrate Homebrew install to appwrite/homebrew-appwrite tap#301ChiragAgg5k wants to merge 1 commit intomasterfrom
Conversation
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 SummaryThis PR correctly migrates Homebrew distribution from a formula file that was never consumable (the repo name Confidence Score: 5/5Safe 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
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 |
There was a problem hiding this comment.
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.
| 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" |
There was a problem hiding this comment.
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.
|
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. |
Summary
sdk-for-cli is not a Homebrew tap (Homebrew requires the repo to be named
homebrew-<name>), so theFormula/appwrite.rbthat's lived here has never actually been installable viabrew install. This PR migrates the CLI's Homebrew distribution to the dedicated tap atappwrite/homebrew-appwriteand updates the release workflow accordingly.What this changes
Formula/appwrite.rb. The canonical formula now lives inappwrite/homebrew-appwrite. Nothing else referenced this file.HOMEBREW_TAP_GH_TOKENsecret, rewritesFormula/appwrite.rbin the tap with the freshly-built SHA256s, and opens (or updates) a PR on the tap's default branch.brew install appwrite/appwrite/appwrite(the fully-qualified<owner>/<tap>/<formula>form), links out to the tap repo, and covers both macOS and Linux.lib/constants.tsnow exposesHOMEBREW_TAP/HOMEBREW_FORMULAconstants;lib/utils.ts(forbrew info) andlib/commands/update.ts(forbrew upgradeand 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) withcontents: write+pull-requests: writeonappwrite/homebrew-appwrite. Used by the workflow to push the release branch and open the PR.Related PRs
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.appwrite/homebrew-appwritehas been seeded with the formula (verbatim from this repo's master at v18.2.0), README, LICENSE, andbrew test-botCI. Verified end-to-end —brew install appwrite/appwrite/appwriteinstallsv18.2.0andappwrite --versionworks.Test plan
brew install appwrite/appwrite/appwriteinstalls the formula from the new tap andappwrite --versionprints18.2.0..github/workflows/publish.ymlparses cleanly.HOMEBREW_TAP_GH_TOKENsecret added to this repo before the next release.appwrite <tag>onappwrite/homebrew-appwritewith the four updatedsha256values and correctversion.