Skip to content

Migrate cask postflight to postflight_steps once GoReleaser v2.19.0 ships #96

Description

@aiomayo

Context

Homebrew 7.0 deprecated the raw-Ruby postflight cask stanza in favour of a declarative postflight_steps DSL. Our generated cask still emits postflight, so brew prints a deprecation warning on every command that touches the tap. Deprecations become errors in a later Homebrew release.

This could not be fixed alongside the verified: removal because the GoReleaser side does not exist in any stable release yet: hooks.post.install_steps is milestoned for v2.19.0, which is currently unreleased (nightlies only).

What to do when v2.19.0 ships

Bump the pinned GoReleaser in the release workflow, then change each homebrew_casks entry from:

hooks:
  post:
    install: |
      if OS.mac?
        system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/bab"]
      end

to:

hooks:
  post:
    install_steps: |
      on_macos do
        run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{ .StagedPath }}/bab"]
      end

{{ .StagedPath }} is a new GoReleaser template field shipped alongside install_steps, needed because Homebrew's own {{staged_path}} token uses the same delimiters as GoReleaser templates.

Note install_steps is a fixed step vocabulary (run, mkdir_p, move, symlink, terminate_process, …), not arbitrary Ruby — it cannot be a mechanical translation of any more complex hook.

Verification

goreleaser check, then a snapshot build, and confirm the generated cask contains postflight_steps and no postflight. After a release lands, brew update && brew upgrade should print no warning for this tap.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions