name: Build Release Binaries on: push: tags: - 'v*' workflow_dispatch: inputs: targets: description: 'Targets to build (comma-separated: amd64,arm64,armv7)' required: false default: 'amd64' env: CARGO_TERM_COLOR: always jobs: build-amd64: if: >- github.event_name == 'push' || contains(github.event.inputs.targets, 'amd64') runs-on: ubuntu-latest steps: - name: Checkout run: | apt-get update && apt-get install -y git curl AUTH_URL="${{ github.server_url }}/${{ github.repository }}.git" AUTH_URL=$(echo "$AUTH_URL" | sed "s|://|://${{ github.token }}@|") git clone --depth 1 --branch ${{ github.ref_name }} "$AUTH_URL" . git config --global url."https://${{ github.token }}@git.tbs.amn.gg/".insteadOf "ssh://git@git.manko.yoga:222/" git submodule update --init --depth 1 - name: Install Rust and dependencies run: | apt-get install -y cmake pkg-config libasound2-dev build-essential curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85.0 echo "$HOME/.cargo/bin" >> $GITHUB_PATH - name: Build headless binaries run: | export PATH="$HOME/.cargo/bin:$PATH" cargo build --release --bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web - name: Build audio client run: | export PATH="$HOME/.cargo/bin:$PATH" cargo build --release --bin wzp-client --features audio cp target/release/wzp-client target/release/wzp-client-audio cargo build --release --bin wzp-client - name: Run tests run: | export PATH="$HOME/.cargo/bin:$PATH" cargo test --workspace --lib - name: Package run: | mkdir -p 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-audio dist/wzp-linux-amd64/ cp target/release/wzp-web dist/wzp-linux-amd64/ cp target/release/wzp-bench dist/wzp-linux-amd64/ cp -r crates/wzp-web/static dist/wzp-linux-amd64/ cd dist && tar czf wzp-linux-amd64.tar.gz wzp-linux-amd64/ - name: Print artifact info run: | echo "Artifact built: $(ls -lh dist/wzp-linux-amd64.tar.gz)" echo "SHA256: $(sha256sum dist/wzp-linux-amd64.tar.gz)" build-arm64: if: >- github.event_name == 'push' || contains(github.event.inputs.targets, 'arm64') runs-on: ubuntu-latest steps: - name: Checkout run: | apt-get update && apt-get install -y git curl AUTH_URL="${{ github.server_url }}/${{ github.repository }}.git" AUTH_URL=$(echo "$AUTH_URL" | sed "s|://|://${{ github.token }}@|") git clone --depth 1 --branch ${{ github.ref_name }} "$AUTH_URL" . git config --global url."https://${{ github.token }}@git.tbs.amn.gg/".insteadOf "ssh://git@git.manko.yoga:222/" git submodule update --init --depth 1 - name: Install Rust and 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 build-essential curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85.0 export PATH="$HOME/.cargo/bin:$PATH" rustup target add aarch64-unknown-linux-gnu echo "$HOME/.cargo/bin" >> $GITHUB_PATH - name: Build env: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc run: | export PATH="$HOME/.cargo/bin:$PATH" 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: Print artifact info run: | echo "Artifact built: $(ls -lh dist/wzp-linux-arm64.tar.gz)" echo "SHA256: $(sha256sum dist/wzp-linux-arm64.tar.gz)" build-armv7: if: >- github.event_name == 'push' || contains(github.event.inputs.targets, 'armv7') runs-on: ubuntu-latest steps: - name: Checkout run: | apt-get update && apt-get install -y git curl AUTH_URL="${{ github.server_url }}/${{ github.repository }}.git" AUTH_URL=$(echo "$AUTH_URL" | sed "s|://|://${{ github.token }}@|") git clone --depth 1 --branch ${{ github.ref_name }} "$AUTH_URL" . git config --global url."https://${{ github.token }}@git.tbs.amn.gg/".insteadOf "ssh://git@git.manko.yoga:222/" git submodule update --init --depth 1 - name: Install Rust and 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 build-essential curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85.0 export PATH="$HOME/.cargo/bin:$PATH" rustup target add armv7-unknown-linux-gnueabihf echo "$HOME/.cargo/bin" >> $GITHUB_PATH - name: Build env: CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc run: | export PATH="$HOME/.cargo/bin:$PATH" 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: Print artifact info run: | echo "Artifact built: $(ls -lh dist/wzp-linux-armv7.tar.gz)" echo "SHA256: $(sha256sum dist/wzp-linux-armv7.tar.gz)"