ci: auto-update the Homebrew tap formula on each release#56
Merged
Conversation
Add an update-formula job to the Release binaries workflow that, after all four binaries are attached, regenerates Formula/bioassert.rb in the PeterKneale/homebrew-tap repo with the new version and checksums and pushes it, so `brew install` always tracks the latest release. The formula is rebuilt by .github/scripts/update-homebrew-formula.sh, which reads the published .sha256 assets. Pushing to the separate tap repo needs a HOMEBREW_TAP_TOKEN secret (contents:write on homebrew-tap); when it is not set the job logs a warning and skips rather than failing the release. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ensures the Homebrew tap formula is automatically updated whenever a new GitHub Release is published, keeping brew install aligned with the just-published binaries.
Changes:
- Adds an
update-formulajob to the release workflow that runs after all release binaries are uploaded. - Introduces a script to regenerate the Homebrew formula by downloading the release’s published
.sha256assets and rewriting the formula with updated URLs/checksums. - Commits and pushes the updated formula to
PeterKneale/homebrew-tapwhen changes are detected (and safely skips ifHOMEBREW_TAP_TOKENis not configured).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/release-binaries.yml | Adds a post-upload job to regenerate, commit, and push the Homebrew formula to the external tap repo (gated on a secret token). |
| .github/scripts/update-homebrew-formula.sh | New helper script that downloads release checksum assets via gh and rewrites Formula/bioassert.rb with updated version/URLs/checksums. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an
update-formulajob to the Release binaries workflow so the Homebrew tap formula never lags behind a release. After the four binaries are attached, it regeneratesFormula/bioassert.rbinPeterKneale/homebrew-tapwith the new version and checksums and pushes it.How
.github/scripts/update-homebrew-formula.shreads the publishedbioassert-<version>-<platform>.sha256assets and writes a fresh prebuilt-binary formula (tested locally against v3.1.2: valid Ruby, all four checksums match the published files).update-formulajobneeds: upload-binaries, checks out the tap, runs the script, and commits/pushes if the formula changed.Required setup
Pushing to the separate tap repo needs a secret
HOMEBREW_TAP_TOKENwithcontents:writeonPeterKneale/homebrew-tap(a fine-grained PAT scoped to that repo, or a classic PAT withrepo). Add it under the bioassert repo's Actions secrets.If the secret is absent the job logs a warning and skips, so releases keep working until it is configured.
🤖 Generated with Claude Code