Skip to content

Publish the CLI to a Homebrew tap (commercelayer/tap/rail0) after each release - #187

Draft
pviti wants to merge 5 commits into
milestone/nextfrom
feat/homebrew-tap
Draft

pviti wants to merge 5 commits into
milestone/nextfrom
feat/homebrew-tap

Conversation

@pviti

@pviti pviti commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Part of #189 (Homebrew distribution, tracked step by step there). Draft until the tap repository and HOMEBREW_TAP_TOKEN exist.

Brings back the Homebrew channel removed in 0dba1f4 ("drop the Homebrew channel for now", when the repo was private): brew install commercelayer/tap/rail0.

Stacked on #186: the release job now runs at the repo root, which is where the cask is read from. Merge #186 first; this PR then retargets to main.

What changes

  • .goreleaser.yaml: homebrew_casks writes dist/homebrew/Casks/rail0.rb: rail0 plus the r0 alias, bash/zsh/fish completions, man rail0, and a macOS post-install step that lifts the quarantine flag (the binary is not notarized). It uses install_steps, the GoReleaser ≥ 2.19 replacement for the deprecated install.
  • release.yml: new step Update the Homebrew tap, after Publish the GitHub release. GoReleaser no longer pushes the cask itself (skip_upload: true): it would push while the release is still a draft, whose download URLs answer 404, so a brew upgrade in that window would get a broken cask. Without HOMEBREW_TAP_TOKEN the step warns and the release goes ahead. An unchanged cask commits nothing, so a resumed run is harmless.
  • README: Homebrew is the recommended install, with a note that a brew install upgrades through brew upgrade. rail0 update help and docs say the same.
  • selfupdate.ManagedBy: the "dormant" comment is gone. The Caskroom guard (rail0 update → "run brew upgrade rail0") was already there and tested.

Verified locally

  • goreleaser check validates; a snapshot release writes the cask.
  • The cask, pointed at the published v1.7.0 archives and checksums, installs from a local tap: /opt/homebrew/bin/rail0 and r0 both report rail0 1.7.0; completions and the man page are linked; no com.apple.quarantine on the binary. Then uninstalled and untapped.
  • brew style flags 9 layout offenses in the generated file. They only matter for homebrew-core, not for a tap.
  • go test ./... passes; docs regenerated.

Before the first release that uses it (owner actions, not done here)

  1. Create the public repo commercelayer/homebrew-tap, with a Casks/ directory or empty; the step creates it.
  2. Add the repo secret HOMEBREW_TAP_TOKEN to rail0-cli: a fine-grained PAT, or a GitHub App token, with contents: read and write on commercelayer/homebrew-tap only.

The next release (1.7.1 or later) then publishes the cask. Until that release, the README's brew install line finds nothing; that is a reason to release soon after merging, with the tap and the secret already in place.

Also in this PR (homebrew-core preparation, stage 2 of #189)

  • packaging/homebrew/rail0.rb: the homebrew-core formula. It builds from source and adds the r0 alias, completions and man pages, plus livecheck and a test do block. Its url points at v1.7.1; the sha256 is filled in on submission.
  • bin/brew-formula-test: builds the formula from the working tree in a throwaway local tap and runs brew install --build-from-source, brew test, brew audit --strict and brew style. All four pass locally.
  • selfupdate.Packager, which the formula stamps at build time. A packaged build is Homebrew-managed wherever it is installed, so rail0 update points to brew upgrade rail0, and the daily update check is off. Tap and cask installs keep the detection by install path.

…ter the release is published

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pviti
pviti marked this pull request as draft October 30, 2026 08:08
Base automatically changed from chore/public-rail0-go to main October 30, 2026 09:34
pviti and others added 3 commits October 30, 2026 16:37
…lds never self-update

- packaging/homebrew/rail0.rb: builds from source (go), r0 alias, completions, man
  pages, livecheck, MIT, and a test do block (version under both names, an offline
  keys generate, the command tree) — for the homebrew-core submission once the repo
  meets Homebrew's notability bar
- bin/brew-formula-test: builds it from the working tree in a throwaway local tap and
  runs brew install --build-from-source, brew test, brew audit --strict, brew style
- selfupdate.Packager, stamped by the formula's ldflags: the binary is
  package-managed wherever it is installed (rail0 update points to brew upgrade
  rail0) and the daily automatic update check is off; tap/cask installs keep the
  path-based detection

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…se has

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…om the module proxy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pviti pviti added this to the Next release milestone Nov 6, 2026
@pviti
pviti changed the base branch from main to milestone/next November 6, 2026 09:54

This branch has not been deployed

No deployments
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