Uses cargo-zigbuild to target glibc 2.31 for maximum compatibility: - Raspberry Pi OS Bullseye and newer - DietPi, Armbian, Ubuntu 22.04+ Triggered by qbzd-v* tags or manual dispatch. Produces two binaries: qbzd-linux-x86_64, qbzd-linux-aarch64. Creates pre-release on tag push. cc
91 lines
2.7 KiB
YAML
91 lines
2.7 KiB
YAML
name: Build qbzd
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'qbzd-v*'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-x86_64:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: x86_64-unknown-linux-gnu
|
|
- uses: mlugg/setup-zig@v2
|
|
- run: cargo install cargo-zigbuild
|
|
|
|
- name: Install ALSA dev headers
|
|
run: sudo apt-get update && sudo apt-get install -y libasound2-dev
|
|
|
|
- name: Build qbzd (x86_64, glibc 2.31)
|
|
run: cargo zigbuild --release --target x86_64-unknown-linux-gnu.2.31 -p qbzd
|
|
working-directory: crates
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: qbzd-x86_64
|
|
path: crates/target/x86_64-unknown-linux-gnu/release/qbzd
|
|
|
|
build-aarch64:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: aarch64-unknown-linux-gnu
|
|
- uses: mlugg/setup-zig@v2
|
|
- run: cargo install cargo-zigbuild
|
|
|
|
- name: Install cross-compilation deps
|
|
run: |
|
|
sudo dpkg --add-architecture arm64
|
|
sudo sed -i 's/^deb /deb [arch=amd64] /' /etc/apt/sources.list
|
|
echo "deb [arch=arm64] http://ports.ubuntu.com/ jammy main universe" | sudo tee /etc/apt/sources.list.d/arm64.list
|
|
sudo apt-get update
|
|
sudo apt-get install -y libasound2-dev:arm64 gcc-aarch64-linux-gnu
|
|
|
|
- name: Build qbzd (aarch64, glibc 2.31)
|
|
run: |
|
|
export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu
|
|
export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
|
|
cargo zigbuild --release --target aarch64-unknown-linux-gnu.2.31 -p qbzd
|
|
working-directory: crates
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: qbzd-aarch64
|
|
path: crates/target/aarch64-unknown-linux-gnu/release/qbzd
|
|
|
|
release:
|
|
needs: [build-x86_64, build-aarch64]
|
|
if: startsWith(github.ref, 'refs/tags/qbzd-v')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: qbzd-x86_64
|
|
path: artifacts/x86_64
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: qbzd-aarch64
|
|
path: artifacts/aarch64
|
|
|
|
- name: Rename binaries
|
|
run: |
|
|
mv artifacts/x86_64/qbzd artifacts/qbzd-linux-x86_64
|
|
mv artifacts/aarch64/qbzd artifacts/qbzd-linux-aarch64
|
|
chmod +x artifacts/qbzd-*
|
|
|
|
- name: Create release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
prerelease: true
|
|
files: |
|
|
artifacts/qbzd-linux-x86_64
|
|
artifacts/qbzd-linux-aarch64
|