From ca3a3e36b1baa13bdb237d41fbd3f0c9ccc5ecf8 Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 11 Nov 2020 17:25:49 +0100 Subject: [PATCH] Add multiarch release build to rust action Signed-off-by: trivernis --- .github/workflows/rust.yml | 40 +++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c369dd4..16bad50 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,7 +11,6 @@ env: jobs: build: - runs-on: ubuntu-latest steps: @@ -31,3 +30,42 @@ jobs: run: cargo build --verbose - name: Run tests run: cargo test --verbose + + + build-release: + runs-on: ubuntu-latest + strategy: + matrix: + target: [ x86_64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf, aarch64-unknown-linux-gnu, x86_64-pc-windows-gnu ] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.target }} + override: true + - name: Cache cargo builds + uses: actions/cache@v2 + with: + path: | + /tmp/.buildx-cache + target/**/build + target/**/deps + target/**/incremental + ~/.cargo/ + key: ${{ runner.os }}-cargo-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-cargo- + - name: Build Release + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --release --target ${{ matrix.target }} + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: snekcloud-server-${{ matrix.target }} + path: target/${{ matrix.target }}/snekcloud-server \ No newline at end of file