Skip to content

Commit 67d6b7f

Browse files
committed
Improve CI/CD: add caching, smaller binaries, go mod tidy check
1 parent 9c0e015 commit 67d6b7f

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ jobs:
1414
- uses: actions/setup-go@v5
1515
with:
1616
go-version-file: go.mod
17+
cache: true
18+
- name: Check go mod tidy
19+
run: go mod tidy && git diff --exit-code go.mod go.sum
1720
- name: Run tests
1821
run: go test ./...

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ jobs:
1717
- uses: actions/setup-go@v5
1818
with:
1919
go-version-file: go.mod
20+
cache: true
2021

2122
- name: Run tests
2223
run: go test ./...
2324

2425
- name: Build binaries
2526
run: |
2627
VERSION=${GITHUB_REF_NAME#v}
27-
LDFLAGS="-X 'github.com/yourorg/beads_server/internal/cli.version=${VERSION}'"
28+
LDFLAGS="-s -w -X 'github.com/yourorg/beads_server/internal/cli.version=${VERSION}'"
2829
mkdir -p build
2930
GOOS=linux GOARCH=amd64 go build -ldflags="${LDFLAGS}" -o build/bs-linux-amd64 ./cmd/bs
3031
GOOS=windows GOARCH=amd64 go build -ldflags="${LDFLAGS}" -o build/bs-windows-amd64.exe ./cmd/bs

0 commit comments

Comments
 (0)