Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/arch-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
go-version-file: go.mod
- uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
with:
version: v2.18.2
version: v2.19.0
args: release --snapshot --clean --skip=before
- name: Verify rendered packages
run: scripts/verify-package-render.sh
Expand Down
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ homebrew_casks:
description: Automated pull-request review CLI
hooks:
post:
install: |
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/cr"]
install_steps: |
run "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "{{ .StagedPath }}/cr"]
caveats: |
To configure cr, follow the setup examples in the README:
https://github.com/open-cli-collective/codereview-cli#authentication-and-setup
Expand Down
21 changes: 12 additions & 9 deletions scripts/verify-package-render.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,25 @@ require_grep 'binary "cr"' "$cask"
require_grep 'open-cli-collective/codereview-cli/releases/download/v' "$cask"
require_grep 'cr_v#{version}_darwin_arm64.tar.gz' "$cask"
require_grep 'cr_v#{version}_darwin_amd64.tar.gz' "$cask"
require_grep '"com.apple.quarantine", "#{staged_path}/cr"' "$cask"
require_grep '"com.apple.quarantine", "{{staged_path}}/cr"' "$cask"

# The shared release workflow rewrites this legacy postflight block into
# Homebrew's install-step DSL, which has no system_command, by turning each line
# that starts with system_command into a run step. Any other statement survives
# the rewrite and makes Homebrew reject the whole cask as invalid.
# GoReleaser renders the install_steps hook as Homebrew's install-step DSL,
# which has no system_command: any statement other than a run step makes
# Homebrew reject the whole cask as invalid. A legacy postflight block means the
# hook moved back to GoReleaser's deprecated install key, which fails
# `goreleaser check` in the release workflow.
ruby - "$cask" <<'RUBY'
source = File.read(ARGV.fetch(0))
body = source[/ postflight do\n(.*?)\n end/m, 1]
raise "postflight body missing" unless body
raise "legacy postflight block present" if source.match?(/^ postflight do$/)

body = source[/ postflight_steps do\n(.*?)\n end/m, 1]
raise "postflight_steps body missing" unless body

body.each_line do |line|
next if line.strip.empty?
next if line.match?(/\A\s*system_command\s/)
next if line.match?(/\A\s*run\s/)

raise "postflight line is not a bare system_command call: #{line.strip}"
raise "postflight_steps line is not a run step: #{line.strip}"
end
puts "rendered package hook check OK"
RUBY
Expand Down
Loading