Skip to content

Commit

Permalink
(workflow): use zig
Browse files Browse the repository at this point in the history
  • Loading branch information
kameshsampath committed Apr 8, 2024
1 parent 2840346 commit 1967ef6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: stable
- uses: goto-bus-stop/setup-zig@v2
- name: Set output
id: macos_sdk
run: echo "path=$(xcrun --show-sdk-path)" >> $GITHUB_OUTPUT
# More assembly might be required: Docker logins, GPG, etc.
# It all depends on your needs.
- uses: goreleaser/goreleaser-action@v5
Expand All @@ -38,3 +42,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.MY_GH_ACTION_TOKEN }}
KO_DOCKER_REPO: ${{ env.IMAGE_NAME }}/grpc-todo-app
SDK_PATH: ${{ steps.macos_sdk.outputs.path }}
41 changes: 39 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,38 @@ builds:
- "arm64"
env:
- CGO_ENABLED=1
- >-
{{- if eq .Os "darwin" }}
{{- if eq .Arch "amd64"}}CC=zig c -target x86_64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }}
{{- if eq .Arch "arm64"}}CC=zig c -target aarch64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }}
{{- end }}
- >-
{{- if eq .Os "darwin" }}
{{- if eq .Arch "amd64"}}CC=zig c++ -target x86_64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }}
{{- if eq .Arch "arm64"}}CC=zig c++ -target aarch64-macos-none -F{{ .Env.SDK_PATH }}/System/Library/Frameworks{{- end }}
{{- end }}
- >-
{{- if eq .Os "linux" }}
{{- if eq .Arch "amd64" }}CC=zig c -target x86_64-linux-musl{{- end }}
{{- if eq .Arch "arm64"}}CC=zig c -target aarch64-linux-musl{{- end }}
{{- end }}
- >-
{{- if eq .Os "linux" }}
{{- if eq .Arch "amd64" }}CC=zig c++ -target x86_64-linux-musl{{- end }}
{{- if eq .Arch "arm64"}}CC=zig c++ -target aarch64-linux-musl{{- end }}
{{- end }}
- >-
{{- if eq .Os "windows" }}
{{- if eq .Arch "amd64" }}CC=zig c -target x86_64-windows-gnu{{- end }}
{{- if eq .Arch "arm64"}}CC=zig c -target aarch64-windows-gnu{{- end }}
{{- end }}
- >-
{{- if eq .Os "windows" }}
{{- if eq .Arch "amd64" }}CC=zig c++ -target x86_64-windows-gnu{{- end }}
{{- end }}
ignore:
- goos: windows
goarch: arm64
- main: ./cmd/list
id: "list"
binary: list
Expand All @@ -36,7 +68,10 @@ builds:
- "amd64"
- "arm64"
env:
- CGO_ENABLED=1
- CGO_ENABLED=0
ignore:
- goos: windows
goarch: arm64
- main: ./cmd/add
id: "add"
binary: add
Expand All @@ -48,7 +83,9 @@ builds:
- "amd64"
- "arm64"
env:
- CGO_ENABLED=1
- CGO_ENABLED=0
ignore:
- goos: windows

kos:
- id: todo-app-server
Expand Down

0 comments on commit 1967ef6

Please sign in to comment.