Skip to content

Commit fd3b0d2

Browse files
committed
ci: add GoReleaser config and GitHub Actions release workflow
Automates cross-platform builds and GitHub releases on tag push.
1 parent b4dd6ba commit fd3b0d2

File tree

3 files changed

+91
-5
lines changed

3 files changed

+91
-5
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: "1.25"
24+
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v6
27+
with:
28+
version: latest
29+
args: release --clean
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: 2
2+
3+
builds:
4+
- binary: grant
5+
ldflags:
6+
- -s -w
7+
- -X github.com/aaearon/grant-cli/cmd.version={{.Version}}
8+
- -X github.com/aaearon/grant-cli/cmd.commit={{.ShortCommit}}
9+
- -X github.com/aaearon/grant-cli/cmd.buildDate={{.Date}}
10+
goos:
11+
- linux
12+
- darwin
13+
- windows
14+
goarch:
15+
- amd64
16+
- arm64
17+
18+
archives:
19+
- formats:
20+
- tar.gz
21+
format_overrides:
22+
- goos: windows
23+
formats:
24+
- zip
25+
26+
checksum:
27+
name_template: "checksums.txt"
28+
29+
changelog:
30+
sort: asc
31+
filters:
32+
exclude:
33+
- "^docs:"
34+
- "^test:"
35+
- "^ci:"

IMPLEMENTATION_STATUS.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
| 5: CLI Commands | `feat/commands` | ✅ DONE - Merged to main | version, configure, login, logout, elevate, status, favorites + tests. 82 total tests passing |
2020
| 6: Integration Tests & Docs | `feat/integration-tests` | ✅ DONE - Merged to main | integration_test.go (6 tests), enhanced README, CLAUDE.md with patterns, updated Makefile |
2121
| 7: UX Simplification | `feat/simplify-login-ux` | ✅ DONE - Merged to main | Removed MFA config, auto-configure on first login, Identity URL clarification |
22-
| 8: Release Infrastructure | `feat/release` | 📋 TODO | .goreleaser.yml, GitHub Actions CI/CD |
22+
| 8: Release Infrastructure | `feat/release` | ✅ DONE | .goreleaser.yaml, GitHub Actions release workflow |
2323

2424
---
2525

@@ -335,20 +335,40 @@ fa62e5f - feat: simplify login UX - remove MFA config, add auto-configure
335335

336336
---
337337

338-
## Phase 8: Release Infrastructure
338+
## Phase 8: Release Infrastructure (DONE)
339339

340340
**Branch:** `feat/release`
341341

342-
- `.goreleaser.yml` — darwin/amd64+arm64, linux/amd64+arm64, windows/amd64
343-
- `.github/workflows/ci.yml` — on push/PR: test + lint
344-
- `.github/workflows/release.yml` — on tag v*: test + goreleaser
342+
### Implemented
343+
344+
1. **`.goreleaser.yaml`** — GoReleaser v2 configuration
345+
- Binary name: `grant`
346+
- Ldflags: `-s -w` + version/commit/buildDate injection (matches Makefile)
347+
- Targets: linux/darwin/windows on amd64/arm64 (6 binaries)
348+
- Archives: tar.gz for linux/darwin, zip for windows
349+
- Checksums: sha256 (`checksums.txt`)
350+
- Changelog: auto-generated, sorted asc, excludes docs/test/ci commits
351+
352+
2. **`.github/workflows/release.yml`** — GitHub Actions release workflow
353+
- Trigger: push tags matching `v*`
354+
- Steps: checkout (fetch-depth 0), setup Go 1.25, GoReleaser v6 action
355+
- Permissions: `contents: write` for creating releases
356+
- Uses `GITHUB_TOKEN` for authentication
357+
358+
### Verification
359+
- `goreleaser check` — config validated
360+
- `goreleaser release --snapshot --clean` — all 6 targets built successfully
345361

346362
---
347363

348364
## Current File Structure (implemented)
349365

350366
```
351367
grant/
368+
├── .goreleaser.yaml # GoReleaser v2 config (6 targets, ldflags, checksums)
369+
├── .github/
370+
│ └── workflows/
371+
│ └── release.yml # GitHub Actions: tag push → GoReleaser release
352372
├── CLAUDE.md # Project conventions + implementation patterns
353373
├── LICENSE
354374
├── Makefile # build, test, test-integration, test-all, lint, clean

0 commit comments

Comments
 (0)