feat: publish the Homebrew cask from GoReleaser - #16
Merged
Conversation
Closes the automation half of #14. The tap repo (KristofferRisa/homebrew-powerctl) currently carries a 150-line workflow that curls each archive, hashes it, and rewrites the formula from a heredoc — and nothing ever triggered it, so every formula bump so far was a manual workflow_dispatch. GoReleaser already builds those archives and knows their checksums, so it can write the tap itself. The tap becomes generated output rather than a repo to maintain, which removes the manual step without giving up the conventional `brew tap`-shorthand install line. - Add `homebrew_casks` targeting the tap, using the HOMEBREW_TAP_TOKEN secret that already exists but was never wired up. `brews` is not an option: it is hard-deprecated as of GoReleaser v2.16 and the release action floats to `~> v2`. The generated cask keeps Linux amd64/arm64 alongside macOS, matching the formula it replaces. - `skip_upload: auto` so the -rc tags from draft_release.yml never point the tap at a prerelease. - Pass HOMEBREW_TAP_TOKEN to both release workflows. - Rename the artifact powerctl-cli -> powerctl, so the install line is `brew install kristofferrisa/powerctl/powerctl`, per #14. - Fix archives.format/format_overrides.format, deprecated since v2.6; `goreleaser check` now passes with no warnings. - Document Homebrew install and ignore GoReleaser's dist/.
This was referenced Aug 28, 2026
Merged
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.
Closes the automation half of #14 (tasks 2 and 3; task 1 was already done by hand).
Why
The tap lives in
KristofferRisa/homebrew-powerctl— that part is a real Homebrew requirement, sincebrew tap kristofferrisa/powerctlonly resolves to a repo namedhomebrew-*. It can't be merged into this repo without users having to pass a git URL on every tap.But the separate repo isn't what's actually costing anything. The cost is that the tap carries a 150-line workflow that curls each archive, sha256s it, and rewrites the formula from a heredoc — and the
repository_dispatchthat was supposed to trigger it was never added here. Every formula bump so far ran as a manualworkflow_dispatch.GoReleaser already builds those archives and already knows their checksums. Letting it write the tap turns the tap into generated output nobody edits, which removes the manual step and keeps the conventional install line.
What changed
homebrew_casksblock targeting the tap, authenticating with theHOMEBREW_TAP_TOKENsecret that already existed in this repo but was never wired to anything.brews:brewsis hard-deprecated as of GoReleaser v2.16, andrelease.ymlpinsversion: "~> v2", which floats to v2.18 today.brewswould fail outright.depends_on macos:, and GoReleaser's template emitson_linuxwithon_intel/on_arm. The generated cask covers the same four platform/arch pairs as the formula it replaces.skip_upload: "auto"so the-rctags cut bydraft_release.ymlnever point the tap at a prerelease.postflighthook stripscom.apple.quarantine, since the release binaries are unsigned.HOMEBREW_TAP_TOKENto the GoReleaser step.powerctl-cli→powerctl, so the install line isbrew install kristofferrisa/powerctl/powerctlas Add Homebrew formula/tap for easier installation #14 asked.archives.format/format_overrides.format, deprecated since v2.6 and warning on every release.goreleaser checknow passes clean..gitignoregainsdist/.Verification
Ran GoReleaser v2.18.0 locally against this config:
goreleaser check→ clean, no deprecation warnings (it flaggedbinary→binariesand a no-opconflicts.formulaon the way, both fixed).goreleaser release --snapshot --clean --skip=publish→ built all six targets and wrotedist/homebrew/Casks/powerctl.rbwithon_macos/on_linux×on_intel/on_arm, correct URLs and checksums.make checkpasses.The publish path itself (the push to the tap) is the one thing not exercised locally — it needs the real token.
Follow-up, not in this PR
Once a real tag lands and the tap gets its first automated commit:
update-formula.ymland its release-creation step from the tap (it also cuts a duplicate GitHub Release per version).Formula/powerctl-cli.rb.Left deliberately for after the first successful run, so the old path stays intact if anything goes wrong.
One deviation from plan
I'd intended an alias so existing
powerctl-cliinstalls migrate silently. There isn't a clean mechanism: GoReleaser'sconflicts.formulais a no-op that Homebrew removed, and a cask sharing a name with the tap's formula creates resolution ambiguity. Migration is a README line instead — proportionate at v0.3.0 with a tap that's existed since January.⚡ Built on gilfoyle with Claude Code