Releases are built and published by GoReleaser on every v* tag pushed to main. The config lives at .goreleaser.yaml. The workflow lives at .github/workflows/release.yml. A second step runs hack/publish-formula.sh to template and push a Homebrew formula to the tap repo.
Done once by a maintainer. Skip every step that is already done.
The release workflow publishes a formula to a separate tap repository on every release. The tap repo must exist before the first release.
- Create a public repo named
homebrew-tapunder the same owner ascipher(so the URL ishttps://github.com/dcadolph/homebrew-tap). - Add a
Formula/directory (an empty commit with.gitkeepis fine). - No further setup is required.
hack/publish-formula.shwritesFormula/cipher.rbon each release.
The release workflow needs a token that can push to the tap repo. The default GITHUB_TOKEN only has access to the calling repo, so a personal access token is required.
- Create a fine-grained personal access token at https://github.com/settings/tokens?type=beta.
- Restrict it to the
dcadolph/homebrew-taprepository. - Grant
Contents: read and writeandMetadata: read-only. - In the
cipherrepo, add the token as an Actions secret namedTAP_GITHUB_TOKENat https://github.com/dcadolph/cipher/settings/secrets/actions.
brew install goreleaser
goreleaser check
goreleaser release --snapshot --clean--snapshot skips the publish step and writes binaries to dist/.
-
Make sure
mainis green on CI. -
Pick a tag in
vMAJOR.MINOR.PATCHform. Pre-1.0 usesv0.MINOR.PATCH. -
Tag and push:
git tag -s v0.1.0 -m "v0.1.0" git push origin v0.1.0 -
The release workflow runs. When it finishes:
- A GitHub release with binaries and
checksums.txtis published at https://github.com/dcadolph/cipher/releases/tag/v0.1.0. - A commit lands on
dcadolph/homebrew-tapupdatingFormula/cipher.rb. - End users can immediately run
brew install dcadolph/tap/cipher.
- A GitHub release with binaries and
| Target | Artifacts |
|---|---|
| Linux amd64 and arm64 | cipher_VERSION_Linux_x86_64.tar.gz, cipher_VERSION_Linux_arm64.tar.gz. |
| macOS amd64 and arm64 | cipher_VERSION_Darwin_x86_64.tar.gz, cipher_VERSION_Darwin_arm64.tar.gz. |
| Windows amd64 and arm64 | cipher_VERSION_Windows_x86_64.zip, cipher_VERSION_Windows_arm64.zip. |
| Checksums | checksums.txt with SHA-256 for every artifact. |
| Homebrew formula | Pushed to dcadolph/homebrew-tap under Formula/cipher.rb. Points at the release archive URLs and their SHA-256 sums. End users install with brew install dcadolph/tap/cipher (no brew trust prompt since formulae are auto-trusted). |
Each archive bundles README.md, LICENSE, and SECURITY.md alongside the binary.
-
Delete the GitHub release at https://github.com/dcadolph/cipher/releases.
-
Delete the tag locally and on the remote:
git tag -d v0.1.0 git push --delete origin v0.1.0
-
Revert the formula commit on
dcadolph/homebrew-tap.
Yanking should be rare. Prefer cutting a fix release with a bumped patch.