fix(casks): rewrite postflight blocks in the test workflow

GoReleaser regenerates each cask with a postflight block, which Homebrew rejects. A script now rewrites it to postflight_steps before test-bot runs. The four current casks are rewritten as well.
This commit is contained in:
2026-10-03 04:44:06 +01:00
parent a50713a835
commit 1b62a018ec
6 changed files with 23 additions and 17 deletions
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
# GoReleaser writes the quarantine hook as a postflight block, which Homebrew rejects
# with Cask/InstallSteps. Rewrite it to postflight_steps.
set -euo pipefail
for cask in Casks/*.rb; do
perl -0pi -e 's| postflight do\n if OS\.mac\?\n system_command "/usr/bin/xattr",\n\s+args: \["-dr", "com\.apple\.quarantine", "#\{staged_path\}/([\w-]+)"\]\n end\n end\n| postflight_steps do\n on_macos do\n run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{staged_path}}/$1"]\n end\n end\n|' "$cask"
done