Skip to content

Commit 1317e04

Browse files
committed
ci: enable CGO and add Zig setup
- Remove CGO_ENABLED=0 and enable CGO_ENABLED=1 in .goreleaser.yml - Install Zig via setup-zig action in release workflow - Set CC=zig cc in CI env for cross-platform builds
1 parent 616eaee commit 1317e04

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
with:
2323
go-version: "1.23.x"
2424

25+
- name: Install cross tool‑chain
26+
uses: goto-bus-stop/setup-zig@v2
27+
2528
- name: Run GoReleaser
2629
uses: goreleaser/goreleaser-action@v6
2730
with:
@@ -32,3 +35,5 @@ jobs:
3235
env:
3336
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3437
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
38+
CC: zig cc
39+
CGO_ENABLED: 1

.goreleaser.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@ before:
33
hooks:
44
- go mod tidy
55
builds:
6-
- binary: grab
6+
- id: grab
7+
binary: grab
78
main: ./cmd/grab
8-
goos:
9-
- darwin
10-
- linux
11-
- windows
12-
goarch:
13-
- amd64
14-
- arm64
9+
goos: [darwin, linux, windows]
10+
goarch: [amd64, arm64]
1511
env:
16-
- CGO_ENABLED=0
12+
- CGO_ENABLED=1
13+
- CC=gcc
1714
ldflags:
1815
- -s -w
1916
- -X github.com/epilande/codegrab/internal/utils.Version={{.Version}}

0 commit comments

Comments
 (0)