Skip to content

goreleaser: use homebrew_casks hooks.post.install_steps - #83

Merged
zfields merged 1 commit into
blues:masterfrom
zakoverflow:fix-cask-postflight-steps
Nov 18, 2026
Merged

zfields merged 1 commit into
blues:masterfrom
zakoverflow:fix-cask-postflight-steps

Conversation

@zakoverflow

Copy link
Copy Markdown
Contributor

Problem

brew upgrade blues/note-cli/note-cli prints this warning:

Warning: Calling `postflight` is deprecated! Use `postflight_steps` instead.
  .../Taps/blues/homebrew-note-cli/Casks/note-cli.rb:37

Homebrew 7.0.0 deprecated the Ruby postflight block in casks and replaced it with the declarative postflight_steps. Third-party taps get a warning until 2027-12-11.

GoReleaser generates Casks/note-cli.rb from homebrew_casks.hooks.post.install. That is why the fix goes here and not in the tap.

Change

This PR moves the quarantine hook to hooks.post.install_steps. GoReleaser v2.19.0 added that field (see also goreleaser#6870). The new config matches GoReleaser's documented quarantine example. The hook has the same effect as before: it runs xattr -dr com.apple.quarantine on notecard and notehub, on macOS only.

The release workflow uses goreleaser-action@v7 with version: '~> v2', which currently resolves to v2.20.2. This PR does not need a version pin change.

Verification

  • goreleaser check (v2.20.2) passes.
  • I ran a snapshot release with darwin excluded. The generated cask has postflight_steps do / on_macos do / run "/usr/bin/xattr" ... "{{staged_path}}/..." and does not have postflight do.

Not verified

  • The darwin cask sections were not rendered, because the build machine has no clang for the cgo darwin builds.
  • brew was not run on the new cask.
  • After the next tagged release, run brew upgrade blues/note-cli/note-cli on a Mac. Confirm that the warning is gone and that notecard and notehub run.

Blast radius

  • The change touches only the release config. The tap's note-cli.rb changes at the next tagged release.
  • The generated cask uses postflight_steps, which requires Homebrew 7.0.0 or later. Users on an older Homebrew can fail to load the cask after the next release.
  • A local GoReleaser older than v2.19 fails on install_steps. CI is not affected.
  • On Linux, the step does nothing, and the warning goes away.

Homebrew 7 deprecates cask postflight in favor of postflight_steps.
GoReleaser v2.19 added hooks.install_steps; the raw Ruby install hook
is deprecated. Same macOS-only quarantine strip, declarative form.
@zakoverflow

Copy link
Copy Markdown
Contributor Author

Dev lead sign-off at head 57977ea.

  • Diff: .goreleaser.yaml only, +4/−4. hooks.post.install becomes install_steps with on_macos / run / {{ .StagedPath }}, the same as GoReleaser's documented quarantine example. This clears Homebrew 7's postflight deprecation warning.
  • Effect is unchanged: xattr -dr com.apple.quarantine on notecard and notehub, macOS only.
  • install_steps needs GoReleaser v2.19 or later. CI resolves ~> v2 (v2.20.2 now). goreleaser check passes.
  • Blast radius: release config only. The generated cask uses postflight_steps, which needs Homebrew 7.0.0 or later.
  • Not verified: darwin cask render and brew upgrade on a Mac. Verify these after the next tagged release.

@zfields
zfields merged commit e251f19 into blues:master Nov 18, 2026
1 check passed
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.

2 participants