From 931f258d1cc64c99b2ddfcf0156cc0f6ef57cb3f Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 5 Nov 2024 21:04:28 +1100 Subject: [PATCH] Fix target passed to install-action Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .github/actions/just-setup/action.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index c4fb35cf..e379571f 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -50,14 +50,18 @@ runs: run: echo "tools=$tools,$inputs_tools" >>"$GITHUB_ENV" shell: bash - - name: Install rust toolchains for local - run: rustup toolchain install stable --no-self-update --profile minimal - shell: bash + - name: Determine native target: + run: | + if [ "$RUNNER_OS" = "Linux" ]; then RUNNER_TARGET=x86_64-unknown-linux-gnu; fi + if [ "$RUNNER_OS" = "macOS" ]; then RUNNER_TARGET=aarch64-apple-darwin; fi + if [ "$RUNNER_OS" = "Windows" ]; then RUNNER_TARGET=x86_64-pc-windows-msvc; fi + echo "RUNNER_TARGET=$RUNNER_TARGET" >>"$GITHUB_ENV" - name: Install tools uses: taiki-e/install-action@v2 with: tool: ${{ env.tools }} + CARGO_BUILD_TARGET: ${{ env.RUNNER_TARGET }} - name: Install rust toolchains run: just toolchain