Distribute via Homebrew; migrate release to GoReleaser#12
Merged
Conversation
Adds a Homebrew install channel (`brew install chenchaoyi/tap/hammer`) without disturbing the existing `curl | sh` installer or `hammer update`. The release pipeline moves from the hand-rolled workflow to GoReleaser, which cross-compiles the same five targets, archives them, emits SHA256SUMS, attaches install.sh, and on a version tag regenerates the Homebrew cask in chenchaoyi/homebrew-tap. Asset names are engineered to be byte-compatible with the old workflow: - hammer-<os>-<arch>.tar.gz / .zip (unchanged) - SHA256SUMS in sha256sum format (unchanged; still includes install.sh) - binary named `hammer` inside (install.sh + updater both accept it) so the curl installer and the self-updater keep working untouched. GoReleaser deprecated `brews` (formulae) in favor of `homebrew_casks`, so the binary ships as a cask. Casks are macOS-only in Homebrew, which is no regression: Linux users already use the curl installer / `hammer update`. The cask strips the Gatekeeper quarantine bit post-install since the binaries are unsigned. workflow_dispatch now runs a snapshot dry-run (artifacts only); real releases are cut by pushing a `v*` tag. Pushing the cask to the tap needs a PAT in the HOMEBREW_TAP_TOKEN secret (the default GITHUB_TOKEN can't write to another repo). TestReleaseWorkflowPublishesInstaller now asserts the installer + stable asset names via .goreleaser.yaml and that the workflow invokes goreleaser. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Adds Homebrew as an install channel for hammer and migrates the release
pipeline to GoReleaser — without disturbing the existing
curl | shinstaller or the built-in
hammer update.brew install chenchaoyi/tap/hammer # or: brew tap chenchaoyi/tap && brew install hammerBackward compatibility (the hard constraint)
GoReleaser is configured to produce byte-compatible release assets, so the
curl installer and self-updater keep working untouched:
hammer-<os>-<arch>.tar.gz/.zipSHA256SUMS(sha256sum format, incl. install.sh)hammer/hammer.exeinstall.shattached to releaseVerified with a local
goreleaser release --snapshot: all five targets archiveto the exact prior names,
SHA256SUMSmatches the expected format, and thetarball contains a
hammerbinary (whichinstall.shandhammer update'sisHammerBinaryboth accept).Homebrew specifics
brews(formulae) → useshomebrew_casks. Casks aremacOS-only, which is no regression: Linux already uses curl /
hammer update.v*tag, GoReleaser regenerates the cask inchenchaoyi/homebrew-tap.Workflow
v*tag push → real release + tap updateworkflow_dispatch→ snapshot dry-run (artifacts only), for validationPrerequisite before the next release
Cross-repo push needs a PAT: add a classic PAT (
reposcope) as theHOMEBREW_TAP_TOKENsecret in this repo. Documented in the follow-up.Tests
TestReleaseWorkflowPublishesInstallerupdated to assert install.sh publishing +stable asset names via
.goreleaser.yamland that the workflow runs goreleaser.go test -race ./...,goreleaser check,gofmtall clean.🤖 Generated with Claude Code