File tree Expand file tree Collapse file tree 3 files changed +89
-66
lines changed
Expand file tree Collapse file tree 3 files changed +89
-66
lines changed Original file line number Diff line number Diff line change 1+ on :
2+ pull_request :
3+ branches :
4+ - master
5+
6+ permissions :
7+ contents : write # needed to write releases
8+
9+ name : Build
10+ jobs :
11+ test-releaser :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Setup go
15+ uses : actions/setup-go@v2
16+ with :
17+ go-version : 1.23.x
18+ - name : Checkout code
19+ uses : actions/checkout@v4
20+ with :
21+ fetch-depth : 0 # this is important, otherwise it won't checkout the full tree (i.e. no previous tags)
22+ - name : Build
23+ env :
24+ PACKAGE_NAME : github.com/lets-cli/lets
25+ GOLANG_CROSS_VERSION : v1.23
26+ run : |
27+ docker run \
28+ --rm \
29+ -e CGO_ENABLED=1 \
30+ -v /var/run/docker.sock:/var/run/docker.sock \
31+ -v `pwd`:/go/src/${PACKAGE_NAME}\
32+ -v `pwd`/sysroot:/sysroot \
33+ -w /go/src/${PACKAGE_NAME} \
34+ ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
35+ --clean --skip=validate --skip=publish --snapshot
36+ # - name: Releaser build
37+ # uses: goreleaser/goreleaser-action@v4
38+ # with:
39+ # distribution: goreleaser
40+ # version: v2.6.1
41+ # args: build --clean --skip=validate --snapshot --single-target
42+ # env:
43+ # GOOS: darwin
44+ # GOARCH: amd64
45+ # ZIG_LOCAL_CACHE_DIR: ${{ steps.set_env.outputs.current_dir }}
46+ # ZIG_GLOBAL_CACHE_DIR: ${{ steps.set_env.outputs.current_dir }}
47+ # SDK_PATH: ${{ steps.set_env.outputs.sdk_path }}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -9,19 +9,51 @@ release:
99 prerelease : auto
1010
1111builds :
12- - env :
13- - CGO_ENABLED=1
14- goos :
15- - linux
12+ - id : goreleaser-zig-cross-compilation-linux-macos
13+ goos :
1614 - darwin
17- goarch :
15+ goarch :
1816 - amd64
1917 - arm64
20- ignore :
21- - goos : linux
22- goarch : arm64
23- ldflags :
24- - -X main.version={{.Version}}
18+ ldflags :
19+ - -s -w -X main.version={{.Version}}
20+ flags :
21+ - -trimpath
22+ - -buildmode=pie
23+ env :
24+ - CGO_ENABLED=1
25+ - >-
26+ {{- if eq .Os "darwin" }}
27+ {{- if eq .Arch "amd64"}}CC=zig c -target x86_64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }}
28+ {{- if eq .Arch "arm64"}}CC=zig c -target aarch64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }}
29+ {{- end }}
30+ - >-
31+ {{- if eq .Os "darwin" }}
32+ {{- if eq .Arch "amd64"}}CC=zig c++ -target x86_64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }}
33+ {{- if eq .Arch "arm64"}}CC=zig c++ -target aarch64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }}
34+ {{- end }}
35+ - id : goreleaser-zig-cross-compilation-linux
36+ goos :
37+ - linux
38+ goarch :
39+ - amd64
40+ # - arm64
41+ ldflags :
42+ - -s -w -X main.version={{.Version}}
43+ flags :
44+ - -trimpath
45+ env :
46+ - CGO_ENABLED=1
47+ - >-
48+ {{- if eq .Os "linux" }}
49+ {{- if eq .Arch "amd64" }}CC=zig c -target x86_64-linux-musl{{- end }}
50+ {{- if eq .Arch "arm64"}}CC=zig c -target aarch64-linux-musl{{- end }}
51+ {{- end }}
52+ - >-
53+ {{- if eq .Os "linux" }}
54+ {{- if eq .Arch "amd64" }}CC=zig c++ -target x86_64-linux-musl{{- end }}
55+ {{- if eq .Arch "arm64"}}CC=zig c++ -target aarch64-linux-musl{{- end }}
56+ {{- end }}
2557
2658archives :
2759- formats : [tar.gz]
You can’t perform that action at this time.
0 commit comments