From 1d8756508d2fa8d04ca1045480577bad2346809d Mon Sep 17 00:00:00 2001 From: Joel Wetzell Date: Sun, 17 May 2026 12:17:19 -0500 Subject: [PATCH] split linux build into two --- .github/workflows/release-showbridge.yaml | 47 +++++++++++++++++------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-showbridge.yaml b/.github/workflows/release-showbridge.yaml index b55c03a..30d6740 100644 --- a/.github/workflows/release-showbridge.yaml +++ b/.github/workflows/release-showbridge.yaml @@ -10,8 +10,8 @@ permissions: contents: write jobs: - linux: - runs-on: ubuntu-latest + linux_amd64: + runs-on: ubuntu-24.04 steps: - name: checkout uses: actions/checkout@v6 @@ -21,10 +21,6 @@ jobs: 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: install alsa lib run: sudo apt-get install -y libasound2-dev - name: setup env variables @@ -34,19 +30,46 @@ jobs: - name: clean tag if: startsWith(github.ref, 'refs/tags/v') run: echo "SHOWBRIDGE_VERSION=${SHOWBRIDGE_VERSION#v}" >> $GITHUB_ENV - - name: build amd64 + - name: build run: | - CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC="zig cc -target x86_64-linux-musl" CXX="zig c++ -target x86_64-linux-musl" go build -o showbridge -ldflags="-s -w -X main.version=${SHOWBRIDGE_VERSION}-${SHORT_COMMIT}" ./cmd/showbridge + go build -o showbridge -ldflags="-s -w -X main.version=${SHOWBRIDGE_VERSION}-${SHORT_COMMIT}" ./cmd/showbridge tar -czf showbridge_${SHOWBRIDGE_VERSION}_linux-amd64.tar.gz showbridge - - name: build arm64 + - name: upload linux artifacts + uses: actions/upload-artifact@v7 + if: github.event_name == 'workflow_dispatch' + with: + name: showbridge-linux-amd64 + path: | + showbridge_*.tar.gz + linux_arm64: + runs-on: ubuntu-24.04-arm + 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: install alsa lib + run: sudo apt-get install -y libasound2-dev + - name: setup env variables run: | - CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC="zig cc -target aarch64-linux-musl" CXX="zig c++ -target aarch64-linux-musl" go build -o showbridge -ldflags="-s -w -X main.version=${SHOWBRIDGE_VERSION}-${SHORT_COMMIT}" ./cmd/showbridge + 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 + run: | + go build -o showbridge -ldflags="-s -w -X main.version=${SHOWBRIDGE_VERSION}-${SHORT_COMMIT}" ./cmd/showbridge tar -czf showbridge_${SHOWBRIDGE_VERSION}_linux-arm64.tar.gz showbridge - name: upload linux artifacts uses: actions/upload-artifact@v7 if: github.event_name == 'workflow_dispatch' with: - name: showbridge-linux + name: showbridge-linux-arm64 path: | showbridge_*.tar.gz windows: @@ -89,7 +112,7 @@ jobs: showbridge_*.zip docker: runs-on: ubuntu-latest - needs: linux + needs: linux_amd64 steps: - name: Check out repository uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0