Skip to content

ci(release): bump the Homebrew cask automatically on release - #53

Merged
Periicles merged 3 commits into
mainfrom
feature/cask-auto-bump
Aug 31, 2026
Merged

ci(release): bump the Homebrew cask automatically on release#53
Periicles merged 3 commits into
mainfrom
feature/cask-auto-bump

Conversation

@Periicles

Copy link
Copy Markdown
Owner

Why

Nothing tells an installed NotchBar that a newer version exists, and the one channel that could update itself — Homebrew — was bumped by hand. Between a release and that manual bump, brew upgrade --cask notchbar was a no-op: users stayed on the old version without any signal. Someone is running 0.1.0 today.

This closes the Homebrew half of the problem. The in-app update check is a separate piece of work.

What

  • scripts/bump-cask.sh VERSION TAP_DIR [--dry-run] — downloads the .dmg attached to the release, computes its sha256 on the exact bytes Homebrew will fetch, rewrites version and sha256 in the tap's cask, then pushes a branch and opens a pull request with auto-merge on. It is idempotent (a cask already on that version and hash exits 0) and refuses to open a PR if either substitution silently missed.
  • A bump-cask job in release.yml, running after the release is published, on ubuntu-latest with read-only permissions on this repo — every write to the tap goes through TAP_TOKEN.
  • README gains an Updating section (one route per install method) and documents the bump plus its secret; CHANGELOG entry under Unreleased.

The PR is authored with a PAT rather than GITHUB_TOKEN, because a GITHUB_TOKEN PR does not trigger the tap's brew test-bot — which is exactly the check auto-merge has to wait on.

Repository setup already applied on Periicles/homebrew-tap

  • Auto-merge and delete-branch-on-merge enabled.
  • A main ruleset requiring a pull request and a green test-bot check, blocking deletion and force-push. Nothing lands on the tap unmerged or unchecked, including the bot's own bump.

Still needed before the next tag

Create the TAP_TOKEN repository secret here: a fine-grained PAT scoped to Periicles/homebrew-tap with contents, pull requests and issues write access (issues covers the assignee). Without it the bump-cask job fails with an explicit message — the release itself still publishes.

Verification

$ ./scripts/bump-cask.sh 0.3.0 <scratch tap clone forced to 0.2.0> --dry-run
==> sha256 1bc521165e99acda4293e0b06c70730a1a88106a891909a0b4fbb0c0aaa84828
-  version "0.2.0"
+  version "0.3.0"

The computed hash matches the one the live cask already carries for 0.3.0, so the bump would have reproduced the current tap exactly. Also exercised: idempotent re-run against the real tap (exit 0, no change), a malformed version, a directory that is not a tap, and a version with no release (curl 404). Workflow parsed with a YAML loader; no Swift code is touched, so the test suite is unaffected.

Hashes the .dmg attached to a release, rewrites version and sha256 in the
tap's cask, then opens an auto-merging pull request. --dry-run stops after
the rewrite so the substitution can be rehearsed against a tap checkout.
Until now the cask was bumped by hand, so `brew upgrade --cask notchbar`
served the previous version for as long as that took. The job runs after the
release exists, since the sha256 has to come from the published .dmg.

The PR is authored with a PAT rather than GITHUB_TOKEN: a GITHUB_TOKEN PR
does not trigger the tap's test-bot, which is the check auto-merge waits on.
@Periicles Periicles self-assigned this Aug 31, 2026
@Periicles
Periicles merged commit af00837 into main Aug 31, 2026
3 checks passed
@Periicles
Periicles deleted the feature/cask-auto-bump branch August 31, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant