|
| 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` |
0 commit comments