fix: remove all JS-based actions for Forgejo act runner compatibility
act runner uses bare ubuntu:24.04 without Node.js — actions/checkout, actions/upload-artifact, etc. all fail. Replace with plain git clone and shell commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,8 +13,6 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
RUSTUP_HOME: /tmp/rustup
|
|
||||||
CARGO_HOME: /tmp/cargo
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-amd64:
|
build-amd64:
|
||||||
@@ -23,29 +21,32 @@ jobs:
|
|||||||
contains(github.event.inputs.targets, 'amd64')
|
contains(github.event.inputs.targets, 'amd64')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y git curl
|
||||||
|
git clone --depth 1 --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
|
||||||
|
|
||||||
- name: Install Rust and dependencies
|
- name: Install Rust and dependencies
|
||||||
run: |
|
run: |
|
||||||
apt-get update && apt-get install -y curl cmake pkg-config libasound2-dev build-essential
|
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
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85.0
|
||||||
echo "$CARGO_HOME/bin" >> $GITHUB_PATH
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Build headless binaries
|
- name: Build headless binaries
|
||||||
run: |
|
run: |
|
||||||
export PATH="$CARGO_HOME/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
cargo build --release --bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
cargo build --release --bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
||||||
|
|
||||||
- name: Build audio client
|
- name: Build audio client
|
||||||
run: |
|
run: |
|
||||||
export PATH="$CARGO_HOME/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
cargo build --release --bin wzp-client --features audio
|
cargo build --release --bin wzp-client --features audio
|
||||||
cp target/release/wzp-client target/release/wzp-client-audio
|
cp target/release/wzp-client target/release/wzp-client-audio
|
||||||
cargo build --release --bin wzp-client
|
cargo build --release --bin wzp-client
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
export PATH="$CARGO_HOME/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
cargo test --workspace --lib
|
cargo test --workspace --lib
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
@@ -59,11 +60,10 @@ jobs:
|
|||||||
cp -r crates/wzp-web/static 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/
|
cd dist && tar czf wzp-linux-amd64.tar.gz wzp-linux-amd64/
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Print artifact info
|
||||||
uses: actions/upload-artifact@v4
|
run: |
|
||||||
with:
|
echo "Artifact built: $(ls -lh dist/wzp-linux-amd64.tar.gz)"
|
||||||
name: wzp-linux-amd64
|
echo "SHA256: $(sha256sum dist/wzp-linux-amd64.tar.gz)"
|
||||||
path: dist/wzp-linux-amd64.tar.gz
|
|
||||||
|
|
||||||
build-arm64:
|
build-arm64:
|
||||||
if: >-
|
if: >-
|
||||||
@@ -71,24 +71,27 @@ jobs:
|
|||||||
contains(github.event.inputs.targets, 'arm64')
|
contains(github.event.inputs.targets, 'arm64')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y git curl
|
||||||
|
git clone --depth 1 --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
|
||||||
|
|
||||||
- name: Install Rust and cross-compilation tools
|
- name: Install Rust and cross-compilation tools
|
||||||
run: |
|
run: |
|
||||||
dpkg --add-architecture arm64
|
dpkg --add-architecture arm64
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y curl cmake pkg-config gcc-aarch64-linux-gnu libc6-dev-arm64-cross build-essential
|
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
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85.0
|
||||||
export PATH="$CARGO_HOME/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
rustup target add aarch64-unknown-linux-gnu
|
rustup target add aarch64-unknown-linux-gnu
|
||||||
echo "$CARGO_HOME/bin" >> $GITHUB_PATH
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
||||||
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
|
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
|
||||||
run: |
|
run: |
|
||||||
export PATH="$CARGO_HOME/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
cargo build --release --target aarch64-unknown-linux-gnu \
|
cargo build --release --target aarch64-unknown-linux-gnu \
|
||||||
--bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
--bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
||||||
|
|
||||||
@@ -102,11 +105,10 @@ jobs:
|
|||||||
cp -r crates/wzp-web/static 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/
|
cd dist && tar czf wzp-linux-arm64.tar.gz wzp-linux-arm64/
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Print artifact info
|
||||||
uses: actions/upload-artifact@v4
|
run: |
|
||||||
with:
|
echo "Artifact built: $(ls -lh dist/wzp-linux-arm64.tar.gz)"
|
||||||
name: wzp-linux-arm64
|
echo "SHA256: $(sha256sum dist/wzp-linux-arm64.tar.gz)"
|
||||||
path: dist/wzp-linux-arm64.tar.gz
|
|
||||||
|
|
||||||
build-armv7:
|
build-armv7:
|
||||||
if: >-
|
if: >-
|
||||||
@@ -114,24 +116,27 @@ jobs:
|
|||||||
contains(github.event.inputs.targets, 'armv7')
|
contains(github.event.inputs.targets, 'armv7')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y git curl
|
||||||
|
git clone --depth 1 --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }}.git .
|
||||||
|
|
||||||
- name: Install Rust and cross-compilation tools
|
- name: Install Rust and cross-compilation tools
|
||||||
run: |
|
run: |
|
||||||
dpkg --add-architecture armhf
|
dpkg --add-architecture armhf
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y curl cmake pkg-config gcc-arm-linux-gnueabihf libc6-dev-armhf-cross build-essential
|
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
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.85.0
|
||||||
export PATH="$CARGO_HOME/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
rustup target add armv7-unknown-linux-gnueabihf
|
rustup target add armv7-unknown-linux-gnueabihf
|
||||||
echo "$CARGO_HOME/bin" >> $GITHUB_PATH
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
|
||||||
CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc
|
CC_armv7_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc
|
||||||
run: |
|
run: |
|
||||||
export PATH="$CARGO_HOME/bin:$PATH"
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
cargo build --release --target armv7-unknown-linux-gnueabihf \
|
cargo build --release --target armv7-unknown-linux-gnueabihf \
|
||||||
--bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
--bin wzp-relay --bin wzp-client --bin wzp-bench --bin wzp-web
|
||||||
|
|
||||||
@@ -145,24 +150,7 @@ jobs:
|
|||||||
cp -r crates/wzp-web/static 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/
|
cd dist && tar czf wzp-linux-armv7.tar.gz wzp-linux-armv7/
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Print artifact info
|
||||||
uses: actions/upload-artifact@v4
|
run: |
|
||||||
with:
|
echo "Artifact built: $(ls -lh dist/wzp-linux-armv7.tar.gz)"
|
||||||
name: wzp-linux-armv7
|
echo "SHA256: $(sha256sum dist/wzp-linux-armv7.tar.gz)"
|
||||||
path: dist/wzp-linux-armv7.tar.gz
|
|
||||||
|
|
||||||
release:
|
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
needs: [build-amd64]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Download all artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: artifacts
|
|
||||||
|
|
||||||
- name: Create release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
files: artifacts/**/*.tar.gz
|
|
||||||
generate_release_notes: true
|
|
||||||
|
|||||||
Reference in New Issue
Block a user