From 88f6b7b4636e1673b7eb4323f1c21746371add15 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 24 Jan 2023 16:39:44 +0000 Subject: [PATCH] Setup rust build dependencies for rust projects Setup the rust toolchain when a Cargo.toml is detected Signed-off-by: Robin Appelman --- workflow-templates/appstore-build-publish.yml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/workflow-templates/appstore-build-publish.yml b/workflow-templates/appstore-build-publish.yml index 13533092..8fb273b0 100644 --- a/workflow-templates/appstore-build-publish.yml +++ b/workflow-templates/appstore-build-publish.yml @@ -85,6 +85,31 @@ jobs: cd ${{ env.APP_NAME }} composer install --no-dev + - name: Check Cargo.toml + id: check_cargo + uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # v2 + with: + files: "${{ env.APP_NAME }}/Cargo.toml" + + - name: Install musl-tools + if: steps.check_cargo.outputs.files_exists == 'true' + run: | + sudo apt-get install musl-tools + + - name: Setup rust toolchain + uses: actions-rs/toolchain@v1 + if: steps.check_cargo.outputs.files_exists == 'true' + with: + profile: minimal + toolchain: stable + override: true + target: x86_64-unknown-linux-musl + + - name: Install cargo-cross + if: steps.check_cargo.outputs.files_exists == 'true' + run: | + cargo install cross --locked + - name: Build ${{ env.APP_NAME }} # Skip if no package.json if: ${{ steps.versions.outputs.nodeVersion }}