Skip to content

Use postflight_steps in Homebrew cask - #98

Merged
Albert221 merged 1 commit into
mainfrom
cask-postflight-steps
Sep 23, 2026
Merged

Albert221 merged 1 commit into
mainfrom
cask-postflight-steps

Conversation

@Albert221

Copy link
Copy Markdown
Member

Homebrew now warns when installing/upgrading the cask:

Warning: Calling `postflight` is deprecated! Use `postflight_steps` instead.

GoReleaser's hooks.post.install always generates a Ruby postflight do block, so this switches to custom_block to emit the declarative form:

postflight_steps do
  on_macos do
    run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{staged_path}}/poe2arb"]
  end
end

({{staged_path}} is Homebrew's placeholder; it's escaped in .goreleaser.yaml so GoReleaser's templating outputs it literally.)

The committed Casks/poe2arb.rb is patched too, so users get rid of the warning without waiting for a release.

Note: GoReleaser places custom_block at the top of the cask — valid, just out of the conventional stanza order.

Testing

  • goreleaser check passes; snapshot release renders the block above.
  • brew reinstall --cask with the patched cask on Homebrew 7.0.6: no warning, quarantine attribute removed, binary runs.

🤖 Generated with Claude Code

Homebrew deprecated Ruby `postflight do` blocks in casks in favor of
declarative `postflight_steps`. GoReleaser's `hooks.post.install` only
emits the old form, so generate the block via `custom_block` instead,
and patch the committed cask so users stop seeing the warning now.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Albert221 Albert221 added the enhancement New feature or request label Sep 23, 2026
@Albert221
Albert221 merged commit a5045c0 into main Sep 23, 2026
3 checks passed
@Albert221
Albert221 deleted the cask-postflight-steps branch September 23, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant