mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-09-04 04:38:59 +00:00
split linux build into two
This commit is contained in:
@@ -10,8 +10,8 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linux:
|
linux_amd64:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
@@ -21,10 +21,6 @@ jobs:
|
|||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
- name: setup zig
|
|
||||||
uses: mlugg/setup-zig@v2
|
|
||||||
with:
|
|
||||||
version: 0.16.0
|
|
||||||
- name: install alsa lib
|
- name: install alsa lib
|
||||||
run: sudo apt-get install -y libasound2-dev
|
run: sudo apt-get install -y libasound2-dev
|
||||||
- name: setup env variables
|
- name: setup env variables
|
||||||
@@ -34,19 +30,46 @@ jobs:
|
|||||||
- name: clean tag
|
- name: clean tag
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
run: echo "SHOWBRIDGE_VERSION=${SHOWBRIDGE_VERSION#v}" >> $GITHUB_ENV
|
run: echo "SHOWBRIDGE_VERSION=${SHOWBRIDGE_VERSION#v}" >> $GITHUB_ENV
|
||||||
- name: build amd64
|
- name: build
|
||||||
run: |
|
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
|
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: |
|
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
|
tar -czf showbridge_${SHOWBRIDGE_VERSION}_linux-arm64.tar.gz showbridge
|
||||||
- name: upload linux artifacts
|
- name: upload linux artifacts
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
if: github.event_name == 'workflow_dispatch'
|
if: github.event_name == 'workflow_dispatch'
|
||||||
with:
|
with:
|
||||||
name: showbridge-linux
|
name: showbridge-linux-arm64
|
||||||
path: |
|
path: |
|
||||||
showbridge_*.tar.gz
|
showbridge_*.tar.gz
|
||||||
windows:
|
windows:
|
||||||
@@ -89,7 +112,7 @@ jobs:
|
|||||||
showbridge_*.zip
|
showbridge_*.zip
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: linux
|
needs: linux_amd64
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user