ci(release): auto-bump homebrew-tap after release#63
Merged
Conversation
Adds a new `homebrew-tap` job to release.yml that, after both the build matrix and the GitHub release step succeed, checks out vxcozy/homebrew-tap, downloads the 4 freshly-cut release assets, computes sha256 for each, rewrites Formula/clitunes.rb with the new URLs + checksums, and pushes the bump commit on main. Eliminates the manual ~15 minute window between a tag push and `brew upgrade clitunes` actually picking up the new version. Shape: - needs: [build, release] — fires only when the release is already live - if: !contains(github.ref_name, '-rc') — the stable tap skips -rcN tags - curl download has a 5x linear-backoff retry loop to tolerate a small lag between the release job finishing and the asset CDN propagating - python3 in-place rewrite with a per-target regex; guard fails the job loudly if any arch doesn't match exactly once (no silent no-op push) - author is github-actions[bot] so tap history shows automated commits Required before the next release: create a fine-grained PAT with Contents: Read & Write on vxcozy/homebrew-tap and register it as the HOMEBREW_TAP_TOKEN secret on vxcozy/clitunes. Without the secret the checkout step fails loudly on the first run — failure mode is safe. Closes clitunes-7ch / CLI-95
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Lets us validate the homebrew-tap job against an existing release (e.g. v1.2.0) without cutting a new tag. `dry_run` defaults to true so a manual run is never load-bearing by accident; setting it false actually pushes to the tap. build + release now skip on workflow_dispatch (they'd re-publish artifacts that already exist); only the tap-bump job runs.
vxcozy
added a commit
that referenced
this pull request
Apr 19, 2026
Patch release: sakura + heartbeat AGC fixes, firework removal, release.yml auto-bumps the Homebrew tap. First tag after release.yml changed in PR #63 — must be cut as v1.2.1-rc1 first to exercise the full tag-push pipeline (build ×4, release, and the new homebrew-tap job) before cutting v1.2.1. Closes CLI-97 (viz AGC), CLI-95 (tap automation) on the release side.
vxcozy
added a commit
that referenced
this pull request
Apr 19, 2026
Patch release: sakura + heartbeat AGC fixes, firework removal, release.yml auto-bumps the Homebrew tap. First tag after release.yml changed in PR #63 — must be cut as v1.2.1-rc1 first to exercise the full tag-push pipeline (build ×4, release, and the new homebrew-tap job) before cutting v1.2.1. Closes CLI-97 (viz AGC), CLI-95 (tap automation) on the release side.
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
Two-commit PR:
ci(release): auto-bump homebrew-tap after release— adds ahomebrew-tapjob that, after the build matrix and release step succeed, checks outvxcozy/homebrew-tap, downloads the release assets, computes sha256s, rewritesFormula/clitunes.rb, and pushes the bump commit onmain.ci(release): workflow_dispatch entry for tap-bump validation— adds a manual trigger (withtarget_tag+dry_runinputs,dry_rundefault true) so the tap-bump logic can be validated against an existing tag without cutting a new release.buildandreleasejobs skip onworkflow_dispatch; only the tap-bump job runs.Closes
clitunes-7ch/ CLI-95.Why
v1.2.0shipped butbrew upgrade clituneswas a no-op for ~15 minutes because the tap was still pointing atv1.1.0. A human had to clone the tap, fetch 4 tarballs, recompute 4 sha256s, rewrite URLs + checksums, and push. This PR automates that procedure.Option (c) from the plan: a small bash + python step on a first-party
actions/checkout. No third-party actions, easy to audit.The second commit exists because the
-rcskip (commit 1) means RC dry runs can't validate the tap-bump job itself — it would skip itself.workflow_dispatchcloses that gap: run the job manually against an already-released tag to prove the regex + download + rewrite path works end-to-end, withdry_run=trueby default so nothing is ever pushed to the tap accidentally.Behaviour
needs: [build, release]— runs only after the tag's release is live on GitHub.-rcNtags are skipped so the stable tap never tracks a release candidate.buildandreleaseare skipped.homebrew-tapruns againstinputs.target_tag.dry_run=true(default) stops before thegit push;dry_run=falseactually commits.n != 1guard — formula shape change would fail the job loudly rather than silently pushing an untouched commit.always()on theif:expression so the explicit success check onneeds.{build,release}runs instead of GitHub short-circuiting to "skip on needs-skipped".github-actions[bot].Secret provisioning (required before the next tag push)
Create a fine-grained PAT at https://github.com/settings/personal-access-tokens/new:
vxcozyvxcozy/homebrew-tapAdd to
vxcozy/clitunes→ Settings → Secrets and variables → Actions → New repository secret:HOMEBREW_TAP_TOKEN.Without the secret, the checkout step fails at the first tag push — safe failure mode, no partial state.
Test plan
cargo fmt --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace --all-featuresYAML.load_filevxcozy/homebrew-tapformula — all 4 URL/sha pairs matched exactly oncetarget_tag=v1.2.0, dry_run=true. "Show diff" step should log a no-op diff (tap already points at v1.2.0 after tonight's manual bump). If the diff is clean, the whole tap-bump pipeline is validated and we can trust the next real release.