Skip to content

fix(homebrew): rewrite bump-homebrew.sh to handle multi-arch formulas (#60) - #61

Merged
scott merged 1 commit into
mainfrom
fix/60-bump-homebrew-rewrite
Aug 23, 2026
Merged

fix(homebrew): rewrite bump-homebrew.sh to handle multi-arch formulas (#60)#61
scott merged 1 commit into
mainfrom
fix/60-bump-homebrew-rewrite

Conversation

@scott

@scott scott commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • brew bump-formula-pr can't update URLs nested inside on_macos / on_linux blocks (Homebrew core's stance is "not supported" — Homebrew/brew#8967). Since Formula/gander.rb ships 4 separate binaries (macOS+Linux × arm64/amd64), the original scripts/bump-homebrew.sh errored with Could not find url stanza!.
  • Replace the brew bump-formula-pr call with an inline Ruby rewrite that:

End-to-end verification (closes #60)

  • PR gandermd/homebrew-gander#2 opened against the tap with the expected diff (URLs + SHA256s + tightened test).
  • Audit CI on the bump PR is green.
  • Post-merge brew install gandermd/gander/gander installs v0.12.0; brew test gandermd/gander/gander passes the new --version assertion.
  • brew audit --strict --new --tap=gandermd/gander gander exits 0.

Closes

Notes

  • The brew preflight check is gone — it's no longer required. The script now requires gh (authenticated, repo scope) and ruby (ships with macOS).
  • One stale tap gotcha: git push then immediately brew install on the same checkout can leave the tap cache showing merge-conflict markers from the in-flight push. brew untap && brew tap (or rm -rf $(brew --repository)/Library/Taps/gandermd/homebrew-gander) clears it.

brew bump-formula-pr cannot update URLs nested inside on_macos /
on_linux blocks (Homebrew core's stance: not supported, see
Homebrew/brew#8967). Since Formula/gander.rb ships 4 separate binaries
(macOS+Linux x arm64/amd64), the original bump-homebrew.sh errored with
'Could not find url stanza!'.

Replace the brew bump-formula-pr call with an inline Ruby rewrite:
  - read current version from the formula URL
  - fetch every release asset's SHA256 via gh release view --json assets
  - rewrite v<old> -> v<new> in every URL and update the matching sha256
  - tighten the test do block from --help to --version (idempotent; gander
    gained --version in v0.12.0 — issue #59)
  - branch, commit, push, gh pr create against the tap

End-to-end verified against v0.12.0:
  - PR gandermd/homebrew-gander#2 opened with correct diff
  - audit CI green
  - post-merge brew install + brew test pass
@scott
scott merged commit afc0b30 into main Aug 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant