fix: use catthehacker/ubuntu:act-latest for Forgejo CI runner
The Forgejo runner needs Node.js for actions/checkout@v4. catthehacker/ubuntu:act-latest has Node.js pre-installed. Also install Rust in the workflow since the base image doesn't have it. Build triggers on main + feat/* branches now. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,32 +2,30 @@ name: Build Release Binaries
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- 'feat/*'
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
targets:
|
|
||||||
description: 'Targets to build (comma-separated: amd64,arm64,armv7,mac-arm64)'
|
|
||||||
required: false
|
|
||||||
default: 'amd64'
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Always builds on push tags. On manual dispatch, reads inputs.
|
|
||||||
build-amd64:
|
build-amd64:
|
||||||
if: >-
|
|
||||||
github.event_name == 'push' ||
|
|
||||||
contains(github.event.inputs.targets, 'amd64')
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: rust:1-bookworm
|
image: catthehacker/ubuntu:act-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install Rust + dependencies
|
||||||
run: apt-get update && apt-get install -y cmake pkg-config libasound2-dev
|
run: |
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
|
source "$HOME/.cargo/env"
|
||||||
|
apt-get update && apt-get install -y cmake pkg-config libasound2-dev ninja-build
|
||||||
|
rustc --version
|
||||||
|
|
||||||
- name: Cache cargo
|
- name: Cache cargo
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -39,27 +37,24 @@ jobs:
|
|||||||
key: cargo-amd64-${{ hashFiles('Cargo.lock') }}
|
key: cargo-amd64-${{ hashFiles('Cargo.lock') }}
|
||||||
restore-keys: cargo-amd64-
|
restore-keys: cargo-amd64-
|
||||||
|
|
||||||
- name: Build headless binaries
|
- name: Build relay + tools
|
||||||
run: cargo build --release --bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
|
||||||
|
|
||||||
- name: Build audio client
|
|
||||||
run: |
|
run: |
|
||||||
cargo build --release --bin wzp-client --features audio
|
source "$HOME/.cargo/env"
|
||||||
cp target/release/wzp-client target/release/wzp-client-audio
|
cargo build --release --bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
||||||
cargo build --release --bin wzp-client
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --workspace --lib
|
run: |
|
||||||
|
source "$HOME/.cargo/env"
|
||||||
|
cargo test --workspace --lib
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist/wzp-linux-amd64
|
mkdir -p dist/wzp-linux-amd64
|
||||||
cp target/release/wzp-relay dist/wzp-linux-amd64/
|
cp target/release/wzp-relay dist/wzp-linux-amd64/
|
||||||
cp target/release/wzp-client dist/wzp-linux-amd64/
|
cp target/release/wzp-client dist/wzp-linux-amd64/
|
||||||
cp target/release/wzp-client-audio dist/wzp-linux-amd64/
|
|
||||||
cp target/release/wzp-web dist/wzp-linux-amd64/
|
cp target/release/wzp-web dist/wzp-linux-amd64/
|
||||||
cp target/release/wzp-bench dist/wzp-linux-amd64/
|
cp target/release/wzp-bench dist/wzp-linux-amd64/
|
||||||
cp -r crates/wzp-web/static dist/wzp-linux-amd64/
|
cp -r crates/wzp-web/static dist/wzp-linux-amd64/ 2>/dev/null || true
|
||||||
cd dist && tar czf wzp-linux-amd64.tar.gz wzp-linux-amd64/
|
cd dist && tar czf wzp-linux-amd64.tar.gz wzp-linux-amd64/
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
@@ -68,113 +63,12 @@ jobs:
|
|||||||
name: wzp-linux-amd64
|
name: wzp-linux-amd64
|
||||||
path: dist/wzp-linux-amd64.tar.gz
|
path: dist/wzp-linux-amd64.tar.gz
|
||||||
|
|
||||||
build-arm64:
|
|
||||||
if: >-
|
|
||||||
github.event_name == 'push' ||
|
|
||||||
contains(github.event.inputs.targets, 'arm64')
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: rust:1-bookworm
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install cross-compilation tools
|
|
||||||
run: |
|
|
||||||
dpkg --add-architecture arm64
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y cmake pkg-config gcc-aarch64-linux-gnu libc6-dev-arm64-cross
|
|
||||||
rustup target add aarch64-unknown-linux-gnu
|
|
||||||
|
|
||||||
- name: Cache cargo
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
target
|
|
||||||
key: cargo-arm64-${{ hashFiles('Cargo.lock') }}
|
|
||||||
restore-keys: cargo-arm64-
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
env:
|
|
||||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
|
||||||
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
|
|
||||||
run: |
|
|
||||||
cargo build --release --target aarch64-unknown-linux-gnu \
|
|
||||||
--bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
|
||||||
|
|
||||||
- name: Package
|
|
||||||
run: |
|
|
||||||
mkdir -p dist/wzp-linux-arm64
|
|
||||||
cp target/aarch64-unknown-linux-gnu/release/wzp-relay dist/wzp-linux-arm64/
|
|
||||||
cp target/aarch64-unknown-linux-gnu/release/wzp-client dist/wzp-linux-arm64/
|
|
||||||
cp target/aarch64-unknown-linux-gnu/release/wzp-web dist/wzp-linux-arm64/
|
|
||||||
cp target/aarch64-unknown-linux-gnu/release/wzp-bench dist/wzp-linux-arm64/
|
|
||||||
cp -r crates/wzp-web/static dist/wzp-linux-arm64/
|
|
||||||
cd dist && tar czf wzp-linux-arm64.tar.gz wzp-linux-arm64/
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: wzp-linux-arm64
|
|
||||||
path: dist/wzp-linux-arm64.tar.gz
|
|
||||||
|
|
||||||
build-armv7:
|
|
||||||
if: >-
|
|
||||||
github.event_name == 'push' ||
|
|
||||||
contains(github.event.inputs.targets, 'armv7')
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: rust:1-bookworm
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install cross-compilation tools
|
|
||||||
run: |
|
|
||||||
dpkg --add-architecture armhf
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y cmake pkg-config gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
|
|
||||||
rustup target add armv7-unknown-linux-gnueabihf
|
|
||||||
|
|
||||||
- name: Cache cargo
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
target
|
|
||||||
key: cargo-armv7-${{ hashFiles('Cargo.lock') }}
|
|
||||||
restore-keys: cargo-armv7-
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
env:
|
|
||||||
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
|
||||||
CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc
|
|
||||||
run: |
|
|
||||||
cargo build --release --target armv7-unknown-linux-gnueabihf \
|
|
||||||
--bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
|
||||||
|
|
||||||
- name: Package
|
|
||||||
run: |
|
|
||||||
mkdir -p dist/wzp-linux-armv7
|
|
||||||
cp target/armv7-unknown-linux-gnueabihf/release/wzp-relay dist/wzp-linux-armv7/
|
|
||||||
cp target/armv7-unknown-linux-gnueabihf/release/wzp-client dist/wzp-linux-armv7/
|
|
||||||
cp target/armv7-unknown-linux-gnueabihf/release/wzp-web dist/wzp-linux-armv7/
|
|
||||||
cp target/armv7-unknown-linux-gnueabihf/release/wzp-bench dist/wzp-linux-armv7/
|
|
||||||
cp -r crates/wzp-web/static dist/wzp-linux-armv7/
|
|
||||||
cd dist && tar czf wzp-linux-armv7.tar.gz wzp-linux-armv7/
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: wzp-linux-armv7
|
|
||||||
path: dist/wzp-linux-armv7.tar.gz
|
|
||||||
|
|
||||||
# Release job — creates a release with all artifacts when a tag is pushed
|
|
||||||
release:
|
release:
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
needs: [build-amd64]
|
needs: [build-amd64]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
|||||||
Reference in New Issue
Block a user