feat: Auto-update Homebrew tap on release (closes #28)#31
Merged
Conversation
The fummicc1/homebrew-tap formulae were bootstrapped manually for v0.1.0, so they would drift from every subsequent release without a sync step. Add an update-homebrew-tap job that, on each non-prerelease tag, fetches the per-arch .sha256 release assets and rewrites the version and sha256 fields in both tap formulae, then pushes via a GitHub App token (no PAT). The patch script anchors on each formula url line so it handles the multi-arch on_macos/on_linux block layout without positional fragility. Also document brew install in the CLI and MCP README sections. Claude-Session: https://claude.ai/code/session_01QvZLELvJyEvSiR4SadiSt2
📊 PR Analysis
Automated analysis by swift-complexity CI |
🔍 Complexity Analysis Results✅ All functions are below the complexity threshold of 15. This analysis was performed by swift-complexity itself. |
Use the App's own bot identity (fummicc1-app[bot]) for tap commits instead of github-actions[bot], resolving the slug and numeric user id from the App token so the noreply email is valid and commits verify under the App. Claude-Session: https://claude.ai/code/session_01QvZLELvJyEvSiR4SadiSt2
📊 PR Analysis
Automated analysis by swift-complexity CI |
fummicc1
enabled auto-merge (squash)
June 20, 2026 17:53
🔍 Complexity Analysis Results✅ All functions are below the complexity threshold of 15. This analysis was performed by swift-complexity itself. |
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.
Summary
Completes the
brew install fummicc1/tap/swift-complexitydistribution requested in #28.The tap repository
fummicc1/homebrew-tapand its formulae (swift-complexity.rb/swift-complexity-mcp.rb) were already bootstrapped manually for v0.1.0, but this repository was missing (1) a mechanism to keep the formulae in sync with every release, and (2)brew installinstructions in the README. This PR fills both gaps.Changes
.github/scripts/update_formula.py(new): Rewrites theversionand per-architecturesha256fields by fetching the.sha256assets attached to the release. It anchors on each formulaurlline to map the immediately followingsha256line, so it handles the multi-archon_macos/on_linuxblock layout without positional fragility. Standard library only..github/workflows/release.yml: Adds anupdate-homebrew-tapjob. It runs aftercreate-release, only for non-prereleases. It checks out the tap with a GitHub App token (not a PAT), updates both formulae via the script, then commits & pushes.README.md: Documentsbrew installin the CLI and MCP Installation sections.Prerequisites (post-merge user action⚠️ )
The auto-update job requires the following, which cannot be configured in code:
Contents: Read and writepermission, installed onfummicc1/homebrew-tap.HOMEBREW_TAP_APP_IDandHOMEBREW_TAP_APP_PRIVATE_KEYin this repository.If unset, only this job fails; the release itself (
create-release) is unaffected.Verification
update_formula.py 0.1.0against the current tap formulae reproduces the existingversionandsha256values exactly (idempotency proves the substitution logic is correct).python3 ast.parseconfirms valid syntax.actionlintparsesrelease.ymlsuccessfully (warnings are limited to pre-existing steps; the new job is clean).brew installformatting in the README.https://claude.ai/code/session_01QvZLELvJyEvSiR4SadiSt2