Commit 8c44d13

Karn Wong <[email protected]>
2024-07-25 12:30:36
ci: fix cross-compilation on darwin tag: v0.1.3
1 parent c5106b0
.github/workflows/release.yaml
@@ -31,3 +31,22 @@ jobs:
           args: release --clean --config .goreleaser-linux.yaml
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+  release-darwin-binary:
+    runs-on: macos-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+      - name: Set up Go
+        uses: actions/setup-go@v5
+        with:
+          go-version: stable
+      - name: Release
+        uses: goreleaser/goreleaser-action@v6
+        with:
+          distribution: goreleaser
+          version: "~> v2"
+          args: release --clean --config .goreleaser-darwin.yaml
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
.goreleaser-darwin.yaml
@@ -0,0 +1,14 @@
+---
+version: 2
+
+builds:
+  - env:
+      - CGO_ENABLED=1
+    goos:
+      - darwin
+    goarch:
+      - amd64
+      - arm64
+    ldflags:
+      - -w -s
+      - -X github.com/kahnwong/swissknife/cmd.version={{.Version}}
.goreleaser-linux.yaml
@@ -7,7 +7,6 @@ builds:
     goos:
       - linux
       - windows
-#      - darwin
     goarch:
       - amd64
       - arm64