Skip to content

Commit c4295e5

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 c4295e5

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919

20+
- name: Set up Zig
21+
uses: goto-bus-stop/setup-zig@v2
22+
with:
23+
version: "0.13.0"
24+
2025
- name: Set up Go
2126
uses: actions/setup-go@v5
2227
with:
2328
go-version: "1.23.x"
29+
cache: true
2430

2531
- name: Run GoReleaser
2632
uses: goreleaser/goreleaser-action@v6

.goreleaser.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@ 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=zig cc -target {{ .CrossTarget }}
14+
- CXX=zig c++ -target {{ .CrossTarget }}
1715
ldflags:
1816
- -s -w
1917
- -X github.com/epilande/codegrab/internal/utils.Version={{.Version}}

0 commit comments

Comments
 (0)