Skip to content

Commit 421989f

Browse files
sky-xoclaude
andcommitted
fix: update goreleaser config for v2 deprecations
- Change archives.format to archives.formats - Change brews to homebrew_casks - Add quarantine removal hook for macOS 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1b197cc commit 421989f

3 files changed

Lines changed: 278 additions & 9 deletions

File tree

.goreleaser.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ builds:
2525

2626
archives:
2727
- id: june-archive
28-
format: tar.gz
28+
formats: [tar.gz]
2929
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
3030
files:
3131
- README.md
@@ -45,20 +45,18 @@ changelog:
4545
- "Merge pull request"
4646
- "Merge branch"
4747

48-
brews:
48+
homebrew_casks:
4949
- name: june
5050
repository:
5151
owner: sky-xo
5252
name: homebrew-tap
5353
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
54-
directory: Formula
5554
homepage: "https://github.com/sky-xo/june"
5655
description: "A read-only TUI for viewing Claude Code subagent activity"
57-
license: "MIT"
58-
install: |
59-
bin.install "june"
60-
test: |
61-
system "#{bin}/june", "--help"
56+
hooks:
57+
post:
58+
install: |
59+
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/june"]
6260
6361
release:
6462
github:
Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
# GoReleaser + Homebrew Setup Implementation Plan
2+
3+
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
4+
5+
**Goal:** Enable `brew install sky-xo/tap/june` with pre-built binaries for macOS and Linux.
6+
7+
**Architecture:** GoReleaser builds binaries on tag push via GitHub Actions, uploads to GitHub Releases, and auto-updates the Homebrew tap formula.
8+
9+
**Tech Stack:** GoReleaser, GitHub Actions, Homebrew
10+
11+
---
12+
13+
### Task 1: Create GoReleaser configuration
14+
15+
**Files:**
16+
- Create: `.goreleaser.yaml`
17+
18+
**Step 1: Create the GoReleaser config file**
19+
20+
```yaml
21+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
22+
version: 2
23+
24+
project_name: june
25+
26+
before:
27+
hooks:
28+
- go mod tidy
29+
30+
builds:
31+
- id: june
32+
main: ./main.go
33+
binary: june
34+
env:
35+
- CGO_ENABLED=0
36+
goos:
37+
- darwin
38+
- linux
39+
goarch:
40+
- amd64
41+
- arm64
42+
ldflags:
43+
- -s -w
44+
- -X github.com/sky-xo/june/internal/cli.version={{.Version}}
45+
46+
archives:
47+
- id: june-archive
48+
format: tar.gz
49+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
50+
files:
51+
- README.md
52+
- LICENSE*
53+
54+
checksum:
55+
name_template: "checksums.txt"
56+
algorithm: sha256
57+
58+
changelog:
59+
sort: asc
60+
filters:
61+
exclude:
62+
- "^docs:"
63+
- "^test:"
64+
- "^chore:"
65+
- "Merge pull request"
66+
- "Merge branch"
67+
68+
brews:
69+
- name: june
70+
repository:
71+
owner: sky-xo
72+
name: homebrew-tap
73+
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
74+
directory: Formula
75+
homepage: "https://github.com/sky-xo/june"
76+
description: "A read-only TUI for viewing Claude Code subagent activity"
77+
license: "MIT"
78+
install: |
79+
bin.install "june"
80+
test: |
81+
system "#{bin}/june", "--help"
82+
83+
release:
84+
github:
85+
owner: sky-xo
86+
name: june
87+
draft: false
88+
prerelease: auto
89+
name_template: "v{{ .Version }}"
90+
```
91+
92+
**Step 2: Commit**
93+
94+
```bash
95+
git add .goreleaser.yaml
96+
git commit -m "chore: add goreleaser configuration"
97+
```
98+
99+
---
100+
101+
### Task 2: Create GitHub Actions workflow
102+
103+
**Files:**
104+
- Create: `.github/workflows/release.yml`
105+
106+
**Step 1: Create the workflow file**
107+
108+
```yaml
109+
name: Release
110+
111+
on:
112+
push:
113+
tags:
114+
- "v*"
115+
116+
permissions:
117+
contents: write
118+
119+
jobs:
120+
release:
121+
runs-on: ubuntu-latest
122+
steps:
123+
- name: Checkout
124+
uses: actions/checkout@v4
125+
with:
126+
fetch-depth: 0
127+
128+
- name: Set up Go
129+
uses: actions/setup-go@v5
130+
with:
131+
go-version: stable
132+
133+
- name: Run GoReleaser
134+
uses: goreleaser/goreleaser-action@v6
135+
with:
136+
distribution: goreleaser
137+
version: "~> v2"
138+
args: release --clean
139+
env:
140+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141+
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
142+
```
143+
144+
**Step 2: Commit**
145+
146+
```bash
147+
git add .github/workflows/release.yml
148+
git commit -m "ci: add release workflow"
149+
```
150+
151+
---
152+
153+
### Task 3: Create Homebrew tap repository
154+
155+
**Step 1: Create the repository**
156+
157+
Go to GitHub and create: `github.com/sky-xo/homebrew-tap`
158+
- Public repository
159+
- Initialize with README.md
160+
- Description: "Homebrew formulae for sky-xo projects"
161+
162+
**Step 2: Create GitHub Personal Access Token**
163+
164+
- Go to GitHub Settings -> Developer Settings -> Personal Access Tokens -> Fine-grained tokens
165+
- Create token with:
166+
- Token name: `goreleaser-homebrew-tap`
167+
- Expiration: 1 year (or custom)
168+
- Repository access: Only select repositories -> `sky-xo/homebrew-tap`
169+
- Permissions:
170+
- Contents: Read and write
171+
- Metadata: Read (auto-selected)
172+
- Copy the token
173+
174+
**Step 3: Add secret to june repository**
175+
176+
- Go to `github.com/sky-xo/june` -> Settings -> Secrets and variables -> Actions
177+
- Click "New repository secret"
178+
- Name: `HOMEBREW_TAP_GITHUB_TOKEN`
179+
- Secret: [paste the token from Step 2]
180+
- Click "Add secret"
181+
182+
---
183+
184+
### Task 4: Test locally
185+
186+
**Step 1: Install GoReleaser**
187+
188+
```bash
189+
brew install goreleaser
190+
```
191+
192+
**Step 2: Validate the configuration**
193+
194+
```bash
195+
goreleaser check
196+
```
197+
198+
Expected: "config is valid"
199+
200+
**Step 3: Test build with snapshot**
201+
202+
```bash
203+
goreleaser release --snapshot --clean
204+
```
205+
206+
Expected: Creates `dist/` folder with:
207+
- `june_<version>-SNAPSHOT-<commit>_darwin_amd64.tar.gz`
208+
- `june_<version>-SNAPSHOT-<commit>_darwin_arm64.tar.gz`
209+
- `june_<version>-SNAPSHOT-<commit>_linux_amd64.tar.gz`
210+
- `june_<version>-SNAPSHOT-<commit>_linux_arm64.tar.gz`
211+
- `checksums.txt`
212+
213+
**Step 4: Clean up**
214+
215+
```bash
216+
rm -rf dist/
217+
```
218+
219+
---
220+
221+
### Task 5: Trigger first release
222+
223+
**Step 1: Push commits to main**
224+
225+
```bash
226+
git push origin main
227+
```
228+
229+
**Step 2: Create and push new tag**
230+
231+
```bash
232+
git tag v0.2.0
233+
git push origin v0.2.0
234+
```
235+
236+
**Step 3: Verify release**
237+
238+
- Check GitHub Actions at `github.com/sky-xo/june/actions` for successful run
239+
- Check GitHub Releases at `github.com/sky-xo/june/releases` for binaries
240+
- Check `github.com/sky-xo/homebrew-tap` for new `Formula/june.rb` file
241+
242+
**Step 4: Test Homebrew install**
243+
244+
```bash
245+
brew tap sky-xo/tap
246+
brew install june
247+
june --help
248+
```
249+
250+
Expected: june runs successfully from Homebrew installation
251+
252+
---
253+
254+
### Troubleshooting
255+
256+
**If GoReleaser check fails:**
257+
- Ensure YAML syntax is valid
258+
- Check that main.go exists at repo root
259+
260+
**If GitHub Actions fails:**
261+
- Check that `HOMEBREW_TAP_GITHUB_TOKEN` secret is set
262+
- Verify the PAT has correct permissions for homebrew-tap repo
263+
264+
**If Homebrew formula is not pushed:**
265+
- Verify the PAT token has Contents write permission
266+
- Check GoReleaser logs for authentication errors
267+
268+
**If brew install fails:**
269+
- Wait a few minutes for tap to sync
270+
- Run `brew update` before install
271+
- Check formula syntax at `sky-xo/homebrew-tap/Formula/june.rb`

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/charmbracelet/bubbletea v1.3.10
99
github.com/charmbracelet/glamour v0.10.0
1010
github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834
11+
github.com/charmbracelet/x/ansi v0.10.1
1112
github.com/spf13/cobra v1.10.2
1213
golang.design/x/clipboard v0.7.1
1314
golang.org/x/term v0.38.0
@@ -17,7 +18,6 @@ require (
1718
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
1819
github.com/aymerick/douceur v0.2.0 // indirect
1920
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
20-
github.com/charmbracelet/x/ansi v0.10.1 // indirect
2121
github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
2222
github.com/charmbracelet/x/exp/slice v0.0.0-20250327172914-2fdc97757edf // indirect
2323
github.com/charmbracelet/x/term v0.2.1 // indirect

0 commit comments

Comments
 (0)