diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1aa73a0..f5d35fc 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -40,13 +40,8 @@ jobs: - name: Install extra packages run: | sudo apt-get update && sudo apt-get install -y libatk1.0-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libgtk-3-dev python3-pip tftp - cargo install cargo-zigbuild - sudo pip3 install ziglang + cargo install cross --git https://github.com/cross-rs/cross - - name: Build for Linux x86_64 Headless + - name: Build all targets continue-on-error: false - run: cargo zigbuild --release --no-default-features - - - name: Build for Linux x86_64 - continue-on-error: false - run: cargo zigbuild --release + run: ./cross-build-all.sh diff --git a/cross-build-all.sh b/cross-build-all.sh index b36c279..6040fde 100755 --- a/cross-build-all.sh +++ b/cross-build-all.sh @@ -11,10 +11,8 @@ armv7-unknown-linux-gnueabihf \ arm-unknown-linux-gnueabihf \ ) -# cargo install cargo-zigbuild -pip3 install ziglang -rm -rf assets -mkdir assets 2>/dev/null || true +rm -rf target/assets +mkdir -p target/assets 2>/dev/null || true # Cross-compile for each target platform for target in "${TARGETS[@]}"; do @@ -25,16 +23,17 @@ for target in "${TARGETS[@]}"; do # rustup target add $target + echo; echo "########################################################################################"; echo echo "Cross-compiling gui version for $target..." # cargo zigbuild --release --target "$target" --jobs $(nproc) --bin quick-serve cross build --release --target "$target" --jobs $(nproc) --bin quick-serve - cp -vf target/${target}/release/quick-serve${ext} assets/quick-serve-gui-${target}${ext} || true + cp -vf target/${target}/release/quick-serve${ext} target/assets/quick-serve-gui-${target}${ext} || true + echo; echo "########################################################################################"; echo echo "Cross-compiling the headless version for $target..." # cargo zigbuild --release --target "$target" --no-default-features --jobs $(nproc) cross build --release --target "$target" --no-default-features --jobs $(nproc) --bin quick-serve - cp -vf target/${target}/release/quick-serve${ext} assets/quick-serve-${target}${ext} || true + cp -vf target/${target}/release/quick-serve${ext} target/assets/quick-serve-${target}${ext} || true done -# echo "Cleaning up..." -# cargo clean +exit 0