Hand off Homebrew to a hand-maintained source-built formula in the tap - #26
Conversation
Replace the homebrew_casks block with a GoReleaser v2 brews block so pj publishes a Homebrew formula (rather than a cask) to kevdoran/homebrew-tap. The generated formula installs the prebuilt release binary; an explicit install/test block is included. Docs updated to use the formula install syntax (brew install pj / brew upgrade pj) and the cask-to-formula migration steps are activated. Closes #21 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
GoReleaser removed the `brews` formula key in v2.16 and only supports binary casks; a build-from-source formula must be hand-maintained in kevdoran/homebrew-tap. Drop GoReleaser's Homebrew management and document the formula install + migration. Closes #21 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kevdoran
left a comment
There was a problem hiding this comment.
Review: LGTM with one merge-sequencing caveat ⚠️ (comment-only — reviewer account is also the PR author, so GitHub disallows a formal approval)
What was verified
- The rationale is factually correct. Confirmed against goreleaser.com/deprecations: the
brews(formula) key was deprecated in v2.10 and removed in v2.16; GoReleaser now only emits binaryhomebrew_casksand cannot generate a build-from-source formula. Since.github/workflows/release.ymlfloats onversion: "~> v2", any GoReleaser-managed formula approach would break the next tagged release — dropping GoReleaser's Homebrew management entirely is the right call for issue #21's build-from-source intent. .goreleaser.yaml: only thehomebrew_casksblock removed (with an explanatory comment); builds, archives, notarize, checksum, changelog untouched. Removing a section cannot break v2 parsing. Binary-download installs continue to work from release archives.release.yml:HOMEBREW_TAP_TOKENwas only consumed by the removed GoReleaser Homebrew step; dropping it fromenvis safe and the comment documents why the repo secret is retained. Workflow otherwise untouched. CI Build + Test are green on this branch.- Docs: README + docs/install.md consistently use formula form (
brew install pj/brew upgrade pj); the cask→formula migration section is activated and correct (brew uninstall --cask kevdoran/tap/pj→brew install kevdoran/tap/pj); tap shorthandkevdoran/tap↔homebrew-tapis consistent throughout; "lastest" typo fixed. - PR body deliverable: contains a complete ready-to-paste
Formula/pj.rb(Apache-2.0 matches the repo LICENSE;depends_on "go" => :build; ldflags mirror the Makefile/goreleaser:-X main.version/commit/buildDate, main pkg./cmd/projector;test douses the realpj versionsubcommand) plus atap_migrations.jsonsnippet.
⚠️ Merge-sequencing caveat (the one real gotcha)
The docs describe a state that doesn't exist until the tap follow-up lands: today kevdoran/homebrew-tap ships a cask named pj, so a new user following the updated README (brew install pj) will get the old cask or a confusing result. Recommended order:
- Add
Formula/pj.rb(with a realsha256) andtap_migrations.jsonto the tap; remove/deprecate the cask. - Then merge this PR (or merge both the same day).
Manual steps before the formula works
- Fill in the real tarball
sha256per release (curl -sL <url> | shasum -a 256);brew bump-formula-prautomates later bumps. - Decide on
commit/buildDatefor tarball builds: source tarballs have no git metadata, so the formula falls back to"unknown"— either accept that or hardcode per release. - Sanity-check in the tap:
brew install --build-from-source kevdoran/tap/pj,brew test pj,brew audit --strict pj.
Nothing blocking in this repo's diff itself — ready to merge once the tap sequencing above is planned.
🤖 Generated with Claude Code
Add a homebrew job to the release workflow that computes the new source tarball's sha256, updates the url and sha256 in kevdoran/homebrew-tap's Formula/pj.rb using HOMEBREW_TAP_TOKEN, and pushes the bump. Restores the release automation the GoReleaser cask block used to provide.
|
Follow-up pushed: the release workflow now includes a On each tagged release (after the
Verified locally: workflow YAML parses, and the exact sed/grep sequence was dry-run against the real Not verifiable until a real release: the end-to-end run on Actions. Requires kevdoran/homebrew-tap#1 to be merged first (the job edits 🤖 Generated with Claude Code |
The pj formula builds from the release source tarball with go as a build dependency, replacing the GoReleaser-generated binary cask. tap_migrations.json migrates existing cask installs automatically. See kevdoran/projector#21 and kevdoran/projector#26.
Closes #21
Why this changed direction
The earlier version of this PR distributed
pjvia GoReleaser'sbrews:(formula) key. That key was deprecated in GoReleaser v2.10 and removed in v2.16, and our release workflow floats GoReleaser to~> v2, so the next release that picked up v2.16+ would fail to parse.goreleaser.yaml. GoReleaser can now only emit binaryhomebrew_casks— it cannot generate a build-from-source formula at all.Per maintainer decision, GoReleaser no longer manages Homebrew. The Homebrew formula will be hand-maintained, build-from-source, in the separate
kevdoran/homebrew-taprepo. This PR makes this repo consistent with that decision and hands over everything needed for the tap.What changed in this repo
.goreleaser.yaml— removed the Homebrew block entirely (thebrews:block this PR previously introduced) and replaced it with a comment explaining why Homebrew is no longer GoReleaser-managed. Builds, archives, notarize, checksum, and changelog are untouched — the release still produces the binaries/archives used by the "Binary download" install method..github/workflows/release.yml—HOMEBREW_TAP_TOKENwas only ever passed to the (now-removed) GoReleaser Homebrew step, so it is no longer consumed. Removed it from the GoReleaser step'senvand left a comment noting the secret is retained in repo settings for any future tap automation. The rest of the workflow is unchanged.docs/install.md— Homebrew section uses the formula form (brew install pj/brew upgrade pj, no--cask); added a note that the formula builds from source withgo build(Homebrew pulls ingoas a build dependency). The cask→formula migration section is corrected (brew uninstall --cask kevdoran/tap/pjthenbrew install kevdoran/tap/pj) and notes that atap_migrations.jsonin the tap will eventually automate this.README.md/pj-skill.md— already used the formula form; consistent onbrew tap kevdoran/tap(which Homebrew expands tokevdoran/homebrew-tap).go build ./cmd/projectorandgo vet ./...both pass (packaging/docs change only, no Go code touched).Follow-up in the tap repo (not editable from here)
Add the build-from-source formula below as
Formula/pj.rbinkevdoran/homebrew-tap, plus atap_migrations.jsonso existing cask users auto-migrate. Once those land, cask users can simplybrew upgrade pj.Formula/pj.rb(ready to paste)Notes:
url/sha256track the GitHub source tarball for each release tag. Get the checksum withcurl -sL <url> | shasum -a 256. (Homebrew'sbrew bump-formula-prautomates this on subsequent bumps.)std_go_argsalready sets-o #{bin}/pjand the build mod flags; we only add the version ldflags. The ldflags mirror the repo'sMakefileand the (now-removed).goreleaser.yamlbuilds block:-X main.version=… -X main.commit=… -X main.buildDate=…, main package./cmd/projector.test doblock assertspj versionprints the version string.tap_migrations.json(ready to paste){ "pj": "kevdoran/tap/pj" }This maps the old
kevdoran/tap/pjcask to the new formula, so Homebrew auto-migrates existing cask installs on the nextbrew upgrade.🤖 Generated with Claude Code