mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-17 12:23:22 +00:00
add macos build job
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user