Skip to content

Commit 358cc67

Browse files
trodemasterclaude
andcommitted
ci: add GitHub Actions workflows and GoReleaser config
ci.yml — runs on every push to main and on PRs: - Verifies go.mod/go.sum are tidy (catches uncommitted dependency drift) - make lint (go vet) - make test (go test -race ./...) - make build release.yml — triggers on v* tags: - Full git history checkout for GoReleaser changelog - goreleaser/goreleaser-action@v6 with GITHUB_TOKEN .goreleaser.yaml: - Builds linux/darwin × amd64/arm64 with CGO_ENABLED=0 - tar.gz archives + checksums.txt - Changelog excludes docs/test commits and merge PRs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0ae0dd0 commit 358cc67

3 files changed

Lines changed: 93 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
ci:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-go@v5
17+
with:
18+
go-version-file: go.mod
19+
cache: true
20+
21+
- name: Verify go.mod and go.sum are tidy
22+
run: go mod tidy && git diff --exit-code go.mod go.sum
23+
24+
- name: Lint
25+
run: make lint
26+
27+
- name: Test
28+
run: make test
29+
30+
- name: Build
31+
run: make build

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # GoReleaser needs full history for changelog
17+
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version-file: go.mod
21+
cache: true
22+
23+
- uses: goreleaser/goreleaser-action@v6
24+
with:
25+
version: latest
26+
args: release --clean
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go mod tidy
6+
7+
builds:
8+
- main: ./cmd/botlockbox
9+
binary: botlockbox
10+
env:
11+
- CGO_ENABLED=0
12+
goos:
13+
- linux
14+
- darwin
15+
goarch:
16+
- amd64
17+
- arm64
18+
ldflags:
19+
- -s -w
20+
21+
archives:
22+
- formats: [tar.gz]
23+
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
24+
25+
checksum:
26+
name_template: checksums.txt
27+
28+
changelog:
29+
sort: asc
30+
filters:
31+
exclude:
32+
- '^docs:'
33+
- '^test:'
34+
- 'Merge pull request'

0 commit comments

Comments
 (0)