Skip to content

Commit 9e17336

Browse files
timvwclaude
andcommitted
feat: create proper Homebrew bottle archives in releases
Update release workflow to generate proper Homebrew bottle archives alongside raw binaries for maximum compatibility. Changes: - Create bottles with correct naming: wt--VERSION.PLATFORM.bottle.tar.gz - arm64_sonoma (macOS Apple Silicon) - ventura (macOS Intel) - x86_64_linux (Linux x86_64) - aarch64_linux (Linux ARM64) - Create proper bottle structure: wt/VERSION/bin/wt - Separate Windows build job (no Homebrew on Windows) - Upload both bottles and raw binaries to releases - Generate checksums for all artifacts Bottles are now compatible with Homebrew's bottle DSL. Raw binaries still available for non-Homebrew users. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 4cfa167 commit 9e17336

1 file changed

Lines changed: 83 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 83 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@ jobs:
1818
- goos: linux
1919
goarch: amd64
2020
output: wt-linux-amd64
21+
bottle: x86_64_linux
2122
- goos: linux
2223
goarch: arm64
2324
output: wt-linux-arm64
25+
bottle: aarch64_linux
2426
- goos: darwin
2527
goarch: amd64
2628
output: wt-darwin-amd64
29+
bottle: ventura
2730
- goos: darwin
2831
goarch: arm64
2932
output: wt-darwin-arm64
30-
- goos: windows
31-
goarch: amd64
32-
output: wt-windows-amd64.exe
33+
bottle: arm64_sonoma
3334

3435
steps:
3536
- name: Generate GitHub App token
@@ -49,24 +50,84 @@ jobs:
4950
with:
5051
go-version: '1.23'
5152

53+
- name: Extract version from tag
54+
id: version
55+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
56+
5257
- name: Build binary
5358
env:
5459
GOOS: ${{ matrix.goos }}
5560
GOARCH: ${{ matrix.goarch }}
5661
run: |
5762
mkdir -p dist
58-
go build -ldflags="-s -w -X main.version=${{ github.ref_name }}" -o dist/${{ matrix.output }} .
63+
go build -ldflags="-s -w -X main.version=${{ github.ref_name }}" -o dist/wt .
64+
65+
- name: Create Homebrew bottle
66+
run: |
67+
# Create bottle directory structure: wt/VERSION/bin/wt
68+
mkdir -p wt/${{ steps.version.outputs.VERSION }}/bin
69+
cp dist/wt wt/${{ steps.version.outputs.VERSION }}/bin/
70+
71+
# Create tarball with proper naming: wt--VERSION.PLATFORM.bottle.tar.gz
72+
tar czf wt--${{ steps.version.outputs.VERSION }}.${{ matrix.bottle }}.bottle.tar.gz wt
73+
74+
# Also keep the raw binary for non-Homebrew users
75+
mv dist/wt dist/${{ matrix.output }}
5976
60-
- name: Upload artifact
77+
- name: Upload bottle artifact
6178
uses: actions/upload-artifact@v4
6279
with:
63-
name: ${{ matrix.output }}
80+
name: bottle-${{ matrix.bottle }}
81+
path: wt--${{ steps.version.outputs.VERSION }}.${{ matrix.bottle }}.bottle.tar.gz
82+
if-no-files-found: error
83+
84+
- name: Upload binary artifact
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: binary-${{ matrix.output }}
6488
path: dist/${{ matrix.output }}
6589
if-no-files-found: error
6690

91+
build-windows:
92+
name: Build Windows Binary
93+
runs-on: ubuntu-latest
94+
95+
steps:
96+
- name: Generate GitHub App token
97+
id: generate-token
98+
uses: actions/create-github-app-token@v1
99+
with:
100+
app-id: ${{ secrets.BOT_APP_ID }}
101+
private-key: ${{ secrets.BOT_PRIVATE_KEY }}
102+
103+
- name: Checkout code
104+
uses: actions/checkout@v4
105+
with:
106+
token: ${{ steps.generate-token.outputs.token }}
107+
108+
- name: Set up Go
109+
uses: actions/setup-go@v5
110+
with:
111+
go-version: '1.23'
112+
113+
- name: Build Windows binary
114+
env:
115+
GOOS: windows
116+
GOARCH: amd64
117+
run: |
118+
mkdir -p dist
119+
go build -ldflags="-s -w -X main.version=${{ github.ref_name }}" -o dist/wt-windows-amd64.exe .
120+
121+
- name: Upload Windows artifact
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: binary-wt-windows-amd64.exe
125+
path: dist/wt-windows-amd64.exe
126+
if-no-files-found: error
127+
67128
release:
68129
name: Create Release
69-
needs: build
130+
needs: [build, build-windows]
70131
runs-on: ubuntu-latest
71132

72133
steps:
@@ -85,12 +146,23 @@ jobs:
85146
- name: Download all artifacts
86147
uses: actions/download-artifact@v4
87148
with:
88-
path: dist/
89-
merge-multiple: true
149+
path: artifacts/
150+
151+
- name: Organize release files
152+
run: |
153+
mkdir -p release
154+
155+
# Move bottles to release directory
156+
find artifacts/bottle-* -name "*.bottle.tar.gz" -exec mv {} release/ \;
157+
158+
# Move binaries to release directory
159+
find artifacts/binary-* -type f -exec mv {} release/ \;
160+
161+
ls -la release/
90162
91163
- name: Generate checksums
92164
run: |
93-
cd dist
165+
cd release
94166
shasum -a 256 * > checksums.txt
95167
cat checksums.txt
96168
@@ -101,4 +173,4 @@ jobs:
101173
gh release create ${{ github.ref_name }} \
102174
--title "Release ${{ github.ref_name }}" \
103175
--generate-notes \
104-
dist/*
176+
release/*

0 commit comments

Comments
 (0)