8000 ci(release): open a Homebrew tap bump PR on release tags by lexfrei · Pull Request #326 · aenix-io/aeman · GitHub
[go: up one dir, main page]

Skip to content

ci(release): open a Homebrew tap bump PR on release tags - #326

Closed
lexfrei wants to merge 1 commit into
mainfrom
ci/homebrew-tap-bump
Closed

lexfrei wants to merge 1 commit into
mainfrom
ci/homebrew-tap-bump

Conversation

@lexfrei
@lexfrei lexfrei commented Nov 16, 2026 •
Copy link
Copy Markdown
Contributor

A release tag now opens a pull request in aenix-io/homebrew-tap that points Formula/aeman.rb at the tag's source tarball, so the formula no longer has to be bumped by hand.

The job mints an installation token for a GitHub App with actions/create-github-app-token, scoped to the tap repository with contents and pull-requests write. The workflow's own GITHUB_TOKEN gets no permissions. It downloads the tag tarball, computes its sha256 and rewrites url and sha256 through the contents API. GitHub signs that commit, and a PR opened by an App token triggers the tap's CI.

A formula whose url line no longer has the tag tarball form fails the job instead of passing as "already up to date". Re-running the job for the same tag is safe. It does nothing if the formula is already at that tag, reuses an existing bump branch and skips an already open PR. Tags older than the formula's version are ignored, so a patch release on an older line does not downgrade it. Pre-release tags such as v1.2.3-rc1 do not match the trigger.

A tag older than an open bump PR in the tap opens nothing, and a newer tag closes the older bump PRs with a comment linking its own and deletes their branches.

Setup: the App's client ID is in the HOMEBREW_TAP_CLIENT_ID Actions variable and its private key in the HOMEBREW_TAP_PRIVATE_KEY secret.

Tested offline with gh stubbed: v0.53.1 against the current formula is a no-op, v0.53.0 is skipped as a downgrade, and v0.53.0 against a v0.52.1 formula produces the expected url and sha256 (checked against shasum). A re-run with the branch and PR already in place makes no writes. A re-run with the branch but no PR only opens the PR. With a v1.3.0 bump PR open, v1.2.4 makes no writes and v1.3.1 opens its PR and closes the v1.3.0 one. A run leaves its own same-tag PR, fork PRs and non-tag bump-aeman-* branches alone, and a re-run makes no writes.

The aeman formula in aenix-io/homebrew-tap builds from the tag source
tarball, so every release needs its url and sha256 updated by hand.
A release tag now opens that pull request in the tap, authenticated as
a GitHub App whose installation token is scoped to the tap repository.

The formula is committed through the contents API, so the commit is
signed by GitHub. A re-run of the same tag reuses the branch and skips
an already open pull request; a tag older than the formula's version
is ignored instead of downgrading it. Pre-release tags do not match.

A tag older than an open bump PR opens nothing, and a newer tag closes
the older bump PRs with a comment pointing at its own and deletes
their branches.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@lexfrei
lexfrei force-pushed the ci/homebrew-tap-bump branch from 7a7fa60 to 64c1be6 Compare November 16, 2026 10:43
@lexfrei
lexfrei commented Nov 16, 2026
Copy link
Copy Markdown
Contributor Author

Replaced by #327: GoReleaser now publishes prebuilt binaries and commits the formula to the tap directly, so a bump PR is no longer needed.

@lexfrei lexfrei closed this Nov 16, 2026
@lexfrei
lexfrei deleted the ci/homebrew-tap-bump branch November 16, 2026 11:49
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

0