From 206040d9d6909a4e51c163c2b0987f768eb0b9da Mon Sep 17 00:00:00 2001 From: Byron Hambly Date: Fri, 25 Nov 2022 18:03:57 +0200 Subject: [PATCH] ci: use cargo cross for binary builds related to #1218 --- .github/workflows/build-release-binaries.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-release-binaries.yml b/.github/workflows/build-release-binaries.yml index 66698990..267b3173 100644 --- a/.github/workflows/build-release-binaries.yml +++ b/.github/workflows/build-release-binaries.yml @@ -52,15 +52,19 @@ jobs: - uses: Swatinem/rust-cache@v2.2.0 - - name: Install compiler for armhf arch - if: matrix.target == 'armv7-unknown-linux-gnueabihf' - run: | - sudo apt-get update - sudo apt-get install gcc-arm-linux-gnueabihf + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + target: armv7-unknown-linux-gnueabihf + override: true - name: Build ${{ matrix.target }} ${{ matrix.bin }} release binary - - run: cargo build --target=${{ matrix.target }} --release --package swap --bin ${{ matrix.bin }} + uses: actions-rs/cargo@v1 + with: + command: build + args: --target=${{ matrix.target }} --release --package swap --bin ${{ matrix.bin }} + use-cross: true - name: Smoke test the binary if: matrix.target != 'armv7-unknown-linux-gnueabihf' # armv7-unknown-linux-gnueabihf is only cross-compiled, no smoke test