Skip to content

fix(release): emit Homebrew postflight_steps instead of postflight - #136

Closed
audreyt wants to merge 1 commit into
mnemon-dev:masterfrom
audreyt:fix/homebrew-postflight-steps
Closed

audreyt wants to merge 1 commit into
mnemon-dev:masterfrom
audreyt:fix/homebrew-postflight-steps

Conversation

@audreyt

@audreyt audreyt commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Homebrew now warns on every command that loads the generated cask:

Warning: Calling `postflight` is deprecated! Use `postflight_steps` instead.
Please report this issue to the mnemon-dev/homebrew-tap tap
  /opt/homebrew/Library/Taps/mnemon-dev/homebrew-tap/Casks/mnemon.rb:36

GoReleaser still wraps homebrew_casks.hooks.post.install in postflight do (goreleaser/goreleaser#6873 is open). Until that ships, this moves the quarantine strip into custom_block as postflight_steps + on_macos + run, which Homebrew accepts.

{{ "{{staged_path}}" }} is a two-pass Go template escape: GoReleaser applies the rendered cask a second time, and this form becomes Homebrew's install-time {{staged_path}} token. The macOS-only guard is unchanged so Linux brew install still does not invoke /usr/bin/xattr.

Companion tap PR (stops the warning on the current v0.2.8 cask): mnemon-dev/homebrew-tap#1

Drop custom_block once hooks.post.install_steps exists.

Homebrew deprecated the `postflight` stanza that GoReleaser writes from
`homebrew_casks.hooks.post.install`, so every `brew` command that loads
the cask warned. GoReleaser does not yet have `hooks.post.install_steps`
(goreleaser/goreleaser#6873), so the quarantine xattr strip moves into
`custom_block` as `postflight_steps` with an `on_macos` guard.

The `{{ "{{staged_path}}" }}` escape survives GoReleaser's second
template pass and becomes Homebrew's install-time `{{staged_path}}`
token. Linux installs still skip `/usr/bin/xattr`.
Copilot AI lite review requested due to automatic review settings September 13, 2026 20:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Add regression coverage for the Homebrew cask postflight configuration before approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates GoReleaser Homebrew cask generation to use non-deprecated postflight_steps and documents the fix.

Changes:

  • Adds a macOS-only quarantine-removal step via custom_block.
  • Records the Homebrew warning fix in the changelog.
File summaries
File Summary Findings
CHANGELOG.md Documents the Homebrew fix. None
.goreleaser.yml Configures the custom postflight_steps workaround. Moderate: add regression coverage for the generated cask configuration (2 votes).
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .goreleaser.yml
Comment on lines +74 to +77
custom_block: |
postflight_steps do
on_macos do
run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{ "{{staged_path}}" }}/mnemon"]
@Grivn Grivn closed this Sep 14, 2026
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.

3 participants