From dac4cfe1625b1a8292eb77ffc538d66ca9ee3dc3 Mon Sep 17 00:00:00 2001 From: chrysn Date: Mon, 17 Feb 2025 09:23:00 +0100 Subject: [PATCH 1/2] Export ESPUP_EXPORT_FILE This is primarily useful for hands-off environments where the paths are not exported by default (otherwise, downstream actions would need to hard-code this action's choice of export file), and conveniently allows eliding the parameter during installation (because the variable is used by espup). --- action.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index 6795b78..4fdebb5 100644 --- a/action.yaml +++ b/action.yaml @@ -55,6 +55,7 @@ runs: curl -LO https://github.com/esp-rs/espup/releases/latest/download/espup-${{ env.HOST_TARGET }}.zip unzip -o espup-${{ env.HOST_TARGET }}.zip -d "$HOME/.cargo/bin" chmod +x "$HOME/.cargo/bin/espup"* + echo "ESPUP_EXPORT_FILE=$HOME/exports" >> $GITHUB_ENV - name: Install Xtensa toolchain (Linux, macOS) if: env.HOST_TARGET != 'x86_64-pc-windows-msvc' @@ -62,7 +63,7 @@ runs: run: | source "$HOME/.cargo/env" [[ "${{ inputs.version }}" != latest ]] && version="--toolchain-version ${{ inputs.version }}" || version="" - "$HOME/.cargo/bin/espup" install -l debug --export-file $HOME/exports --targets ${{ inputs.buildtargets }} $version + "$HOME/.cargo/bin/espup" install -l debug --targets ${{ inputs.buildtargets }} $version source "$HOME/exports" echo "$PATH" >> "$GITHUB_PATH" echo "LIBCLANG_PATH=${LIBCLANG_PATH}" >> "$GITHUB_ENV" @@ -72,7 +73,7 @@ runs: shell: bash run: | [[ "${{ inputs.version }}" != latest ]] && version="--toolchain-version ${{ inputs.version }}" || version="" - "$HOME/.cargo/bin/espup.exe" install -l debug --export-file $HOME/exports --targets ${{ inputs.buildtargets }} $version + "$HOME/.cargo/bin/espup.exe" install -l debug --targets ${{ inputs.buildtargets }} $version - name: Set default and override shell: bash From 1f2022897b7807174381aaa48dd8f3bf007ce925 Mon Sep 17 00:00:00 2001 From: chrysn Date: Sun, 16 Feb 2025 13:09:49 +0100 Subject: [PATCH 2/2] Only export LIBCLANG_PATH when override=true Closes: https://github.com/esp-rs/xtensa-toolchain/issues/35 --- action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index 4fdebb5..13422e1 100644 --- a/action.yaml +++ b/action.yaml @@ -66,7 +66,7 @@ runs: "$HOME/.cargo/bin/espup" install -l debug --targets ${{ inputs.buildtargets }} $version source "$HOME/exports" echo "$PATH" >> "$GITHUB_PATH" - echo "LIBCLANG_PATH=${LIBCLANG_PATH}" >> "$GITHUB_ENV" + [[ "${{ inputs.override }}" = true ]] && echo "LIBCLANG_PATH=${LIBCLANG_PATH}" >> "$GITHUB_ENV" || true - name: Install Xtensa toolchain (Windows) if: env.HOST_TARGET == 'x86_64-pc-windows-msvc'