fix: use non-deprecated postflight_steps for cask quarantine removal - #3042
Closed
joaofsantos wants to merge 1 commit into
Closed
joaofsantos wants to merge 1 commit into
joaofsantos wants to merge 1 commit into
Conversation
Homebrew deprecated the postflight block stanza in favor of postflight_steps. Every `brew install`/`upgrade`/`untap` involving the go-task cask currently prints: Warning: Calling `postflight` is deprecated! Use `postflight_steps` instead. This switches to GoReleaser's new (as of goreleaser/goreleaser#7156) opt-in `hooks.use_steps`, which renders the four hook stanzas using Homebrew's non-deprecated `_steps` variants, and rewrites the quarantine-removal hook using the new steps DSL (`on_macos do ... end` instead of checking whether /usr/bin/xattr exists, `run` instead of `system_command`). Note: this depends on goreleaser/goreleaser#7156, which is not merged yet. Not mergeable until that lands in a released goreleaser version this repo's CI picks up. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
|
Please read our contribution guide |
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.
Summary
brew install/upgrade/untapfor thego-taskcask currently prints:Homebrew's docs page linked from this repo's own
.goreleaser.ymlcomment (https://goreleaser.com/customization/homebrew_casks/) still shows the deprecatedpostflightpattern this repo currently uses for quarantine removal, but the underlyingpostflightstanza itself is now deprecated in favor ofpostflight_steps.I opened goreleaser/goreleaser#7156 to add an opt-in
hooks.use_stepsoption to GoReleaser (needed because the new_stepsstanzas use a restricted declarative DSL, not arbitrary Ruby, so it can't be a silent default-on switch). This PR switches.goreleaser.ymlto use it once available, and rewrites the quarantine hook for the new DSL:on_macos do ... endreplaces the old/usr/bin/xattr -hexistence check as the guard for skipping this on Linux builds — same intent (this hook only makes sense on macOS), expressed in the new DSL's own idiom.Verification
I couldn't run this repo's full release pipeline (needs a tagged build + goreleaser Pro fields already in
.goreleaser.yml), but I did verify end-to-end that the generated cask content is valid, using a build of the goreleaser branch from #7156:doBuildCask).postflight_stepsblock via a real Homebrew installation'sCask::CaskLoader.load— parses with zero deprecation warnings, correctpostflight_steps→on_macos→runnesting..goreleaser.yml'shomebrew_casksconfig (including this hook) against goreleaser's config schema viagoreleaser checkwith the same patched build — no schema errors.Status: draft, blocked on goreleaser/goreleaser#7156
This isn't mergeable yet —
hooks.use_stepsdoesn't exist in any released GoReleaser version. Marking as draft until that PR lands and this repo's GoReleaser dependency is bumped to a version that includes it.AI was used to help write this change (implementation and verification); I reviewed and verified it per the notes above.
🤖 Generated with Claude Code