mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-11 09:23:39 +00:00
split linux build into two
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user