From 49227f9a828a61d20d32a2114f9b4281f0dd1a4d Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Sun, 17 May 2026 12:32:57 -0500 Subject: [PATCH] add macos build job --- .github/workflows/release-showbridge.yaml | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/release-showbridge.yaml b/.github/workflows/release-showbridge.yaml index eefd989..a14e4eb 100644 --- a/.github/workflows/release-showbridge.yaml +++ b/.github/workflows/release-showbridge.yaml @@ -110,6 +110,44 @@ jobs: name: showbridge-windows path: | showbridge_*.zip + macos: + runs-on: macos-latest + steps: + - name: checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: setup go + uses: actions/setup-go@v6 + with: + go-version-file: "go.mod" + - name: setup zig + uses: mlugg/setup-zig@v2 + with: + version: 0.16.0 + - name: setup env variables + run: | + echo "SHOWBRIDGE_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV + echo "SHORT_COMMIT=${GITHUB_SHA::7}" >> $GITHUB_ENV + - name: clean tag + if: startsWith(github.ref, 'refs/tags/v') + run: echo "SHOWBRIDGE_VERSION=${SHOWBRIDGE_VERSION#v}" >> $GITHUB_ENV + - name: build amd64 + run: | + SDK_PATH=$(xcrun --show-sdk-path) CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 CC="clang -arch x86_64 -isysroot $SDK_PATH" CXX="clang++ -arch x86_64 -isysroot $SDK_PATH" go build -o showbridge -ldflags="-s -w -X main.version=${SHOWBRIDGE_VERSION}-${SHORT_COMMIT}" ./cmd/showbridge + tar -czf showbridge_${SHOWBRIDGE_VERSION}_macOS-amd64.tar.gz showbridge + - name: build arm64 + run: | + SDK_PATH=$(xcrun --show-sdk-path) CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 CC="clang -arch arm64 -isysroot $SDK_PATH" CXX="clang++ -arch arm64 -isysroot $SDK_PATH" go build -o showbridge -ldflags="-s -w -X main.version=${SHOWBRIDGE_VERSION}-${SHORT_COMMIT}" ./cmd/showbridge + tar -czf showbridge_${SHOWBRIDGE_VERSION}_macOS-arm64.tar.gz showbridge + + - name: upload macos artifacts + uses: actions/upload-artifact@v7 + if: github.event_name == 'workflow_dispatch' + with: + name: showbridge-macos + path: | + showbridge_*.tar.gz docker: runs-on: ubuntu-latest needs: linux_amd64