Skip to content

Commit 3d297c8

Browse files
committed
feat: Implement Homebrew cask migration with dual distribution
- Update GoReleaser config with both formula (deprecated) and cask - Add conflicts_with directive to prevent formula/cask conflicts - Create comprehensive Homebrew build validation script - Add GitHub Actions workflow for automated testing - Move acceptance tests to test-scripts/ directory The migration provides a transition period where both formula and cask work, with clear deprecation warnings guiding users to migrate from formula to cask distribution. Following GoReleaser best practices for distributing pre-built binaries.
1 parent 4763759 commit 3d297c8

5 files changed

Lines changed: 730 additions & 3 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v3
1919
with:
20-
go-version: '1.18'
20+
go-version: "1.18"
2121

2222
- name: Make script executable
23-
run: chmod +x scripts/acceptance-test.sh
23+
run: chmod +x test-scripts/test-acceptance.sh
2424

2525
- name: Run acceptance tests
26-
run: ./scripts/acceptance-test.sh
26+
run: ./test-scripts/test-acceptance.sh
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Homebrew Build Validation
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- ".goreleaser/**"
9+
- "scripts/completions.sh"
10+
- "test-scripts/test-homebrew-build.sh"
11+
- ".github/workflows/test-homebrew-build.yml"
12+
13+
workflow_dispatch:
14+
inputs:
15+
run_install_tests:
16+
description: "Run installation tests"
17+
required: false
18+
default: "false"
19+
type: choice
20+
options:
21+
- "false"
22+
- "true"
23+
24+
jobs:
25+
test-homebrew-build:
26+
runs-on: macos-latest
27+
28+
steps:
29+
- name: Check out code
30+
uses: actions/checkout@v4
31+
32+
- name: Set up Go
33+
uses: actions/setup-go@v5
34+
with:
35+
go-version-file: "go.mod"
36+
37+
- name: Verify Homebrew is installed
38+
run: |
39+
echo "Homebrew version:"
40+
brew --version
41+
42+
- name: Install GoReleaser
43+
run: brew install goreleaser
44+
45+
- name: Make test script executable
46+
run: chmod +x test-scripts/test-homebrew-build.sh
47+
48+
- name: Run build validation
49+
run: ./test-scripts/test-homebrew-build.sh
50+
51+
- name: Run installation tests
52+
if: github.event.inputs.run_install_tests == 'true'
53+
run: ./test-scripts/test-homebrew-build.sh --install
54+
55+
- name: Upload generated Homebrew files
56+
if: always()
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: homebrew-files
60+
path: |
61+
dist/homebrew/Formula/hookdeck.rb
62+
dist/homebrew/Casks/hookdeck.rb
63+
retention-days: 7

.goreleaser/mac.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ homebrew_casks:
8787
bash: "completions/hookdeck.bash"
8888
zsh: "completions/_hookdeck"
8989

90+
# Prevent installation alongside the deprecated formula
91+
# Note: The deprecated 'conflicts' field no longer works, so we use custom_block
92+
custom_block: |
93+
conflicts_with formula: "hookdeck"
94+
9095
caveats: |
9196
Thanks for installing the Hookdeck CLI!
9297

0 commit comments

Comments
 (0)