mirror of
https://github.com/lukaszraczylo/homebrew-taps.git
synced 2026-10-18 01:17:32 +00:00
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:
@@ -37,7 +37,9 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Fix style issues from GoReleaser-generated files
|
- name: Fix style issues from GoReleaser-generated files
|
||||||
run: brew style --fix Casks/*.rb || true
|
run: |
|
||||||
|
scripts/fix-casks.sh
|
||||||
|
brew style --fix Casks/*.rb || true
|
||||||
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
|
working-directory: ${{ steps.set-up-homebrew.outputs.repository-path }}
|
||||||
|
|
||||||
- run: brew test-bot --only-tap-syntax
|
- run: brew test-bot --only-tap-syntax
|
||||||
|
|||||||
@@ -33,10 +33,9 @@ cask "harness-sync" do
|
|||||||
|
|
||||||
binary "harness-sync"
|
binary "harness-sync"
|
||||||
|
|
||||||
postflight do
|
postflight_steps do
|
||||||
if OS.mac?
|
on_macos do
|
||||||
system_command "/usr/bin/xattr",
|
run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{staged_path}}/harness-sync"]
|
||||||
args: ["-dr", "com.apple.quarantine", "#{staged_path}/harness-sync"]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -33,10 +33,9 @@ cask "kportal" do
|
|||||||
|
|
||||||
binary "kportal"
|
binary "kportal"
|
||||||
|
|
||||||
postflight do
|
postflight_steps do
|
||||||
if OS.mac?
|
on_macos do
|
||||||
system_command "/usr/bin/xattr",
|
run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{staged_path}}/kportal"]
|
||||||
args: ["-dr", "com.apple.quarantine", "#{staged_path}/kportal"]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+3
-4
@@ -33,10 +33,9 @@ cask "lolcathost" do
|
|||||||
|
|
||||||
binary "lolcathost"
|
binary "lolcathost"
|
||||||
|
|
||||||
postflight do
|
postflight_steps do
|
||||||
if OS.mac?
|
on_macos do
|
||||||
system_command "/usr/bin/xattr",
|
run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{staged_path}}/lolcathost"]
|
||||||
args: ["-dr", "com.apple.quarantine", "#{staged_path}/lolcathost"]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,9 @@ cask "semver-generator" do
|
|||||||
|
|
||||||
binary "semver-generator"
|
binary "semver-generator"
|
||||||
|
|
||||||
postflight do
|
postflight_steps do
|
||||||
if OS.mac?
|
on_macos do
|
||||||
system_command "/usr/bin/xattr",
|
run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{staged_path}}/semver-generator"]
|
||||||
args: ["-dr", "com.apple.quarantine", "#{staged_path}/semver-generator"]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Executable
+8
@@ -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
|
||||||
Reference in New Issue
Block a user