feat(cli): move Homebrew formula to dedicated homebrew-appwrite tap#1459
feat(cli): move Homebrew formula to dedicated homebrew-appwrite tap#1459ChiragAgg5k merged 2 commits intomasterfrom
Conversation
The CLI's Homebrew formula was checked in to sdk-for-cli itself, which meant users could not `brew install` it because sdk-for-cli is not a Homebrew tap. The official tap lives at appwrite/homebrew-appwrite, so this change: - Drops the `Formula/appwrite.rb` generator (template, `getFiles()` entry, example output, and the `APPWRITE_CLI_HOMEBREW_*_SHA256` env overrides in `example.php`). - Rewrites the CLI publish workflow to compute the per-target SHA256 checksums, check out `appwrite/homebrew-appwrite` with a dedicated `HOMEBREW_TAP_GH_TOKEN`, update `Formula/<executable>.rb` in the tap, and open a pull request back to the tap's default branch. - Points the generated README at the new tap (`brew install appwrite/appwrite/appwrite`) and wires a new `setHomebrewTap($owner, $name)` helper + `homebrewTapOwner` / `homebrewTapName` params on the CLI language class. - Qualifies the self-update and `brew info` calls in `utils.ts` and `update.ts` with the fully-qualified `<tap>/<formula>` reference via new `HOMEBREW_TAP` / `HOMEBREW_FORMULA` constants so lookups keep resolving to the Appwrite tap if another tap ever ships an `appwrite` formula.
Greptile SummaryThis PR migrates the CLI's Homebrew formula from the generated The one inconsistency: Confidence Score: 4/5Safe to merge for Appwrite's current setup; one template inconsistency should be fixed for correctness of the generator abstraction. All P2 finding: HOMEBREW_TAP_REPO hardcoded instead of using the new Twig params. With defaults of appwrite/appwrite this generates the correct value today, but breaks the abstraction if setHomebrewTap() is ever called with different values. No P0/P1 logic bugs found. templates/cli/.github/workflows/publish.yml — line 20 HOMEBREW_TAP_REPO should use Twig params Important Files Changed
Reviews (2): Last reviewed commit: "Make CLI tap workflow generic and trim c..." | Re-trigger Greptile |
Addresses review feedback on PR #1459: - Discover EXECUTABLE_NAME from the tap's Formula/*.rb at runtime (replaces the hardcoded `appwrite` used by the earlier checksum step). Publishing works for any CLI whose formula filename matches its binary prefix. - PR body now builds the source-release URL from `github.server_url` + `github.repository`, and derives the workflow-repo short name via bash parameter expansion — no more hardcoded `appwrite/sdk-for-cli`. - Promote the tap coordinate to a single `HOMEBREW_TAP_REPO` job-level env var, consumed by `actions/checkout@v4`. - Fold the separate "Compute native binary checksums" step into the tap update step now that formula discovery lives in the tap checkout. - Drop redundant prose: the 4-line block comment above the Homebrew steps, the 3-line param comment in CLI.php, the verbose setHomebrewTap docblock, the HOMEBREW_FORMULA_NAME alias + its comment in utils.ts, and the needless `first time: brew tap` hint in update.ts manual instructions.
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.
Summary
The CLI's Homebrew formula has lived in the generated sdk-for-cli repository itself, which meant users could not actually `brew install appwrite` — a Homebrew tap must live in a repo named `homebrew-`. The new tap is appwrite/homebrew-appwrite and this PR rewires the generator to publish into it.
What this changes
Required secrets
The generated workflow reads a new secret in sdk-for-cli:
The existing `GH_TOKEN` secret continues to be used for the sdk-for-cli checkout + the GitHub release upload.
Related PRs
Test plan