From 355c5a46b2823a1bf33235fb1959d4bacf55df99 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sun, 21 Dec 2025 16:05:43 +0000 Subject: [PATCH] Fix PATH manipulation in action.yml --- action.yml | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/action.yml b/action.yml index 843b5329..97877f30 100644 --- a/action.yml +++ b/action.yml @@ -75,32 +75,37 @@ runs: with open(os.environ["GITHUB_OUTPUT"], "at") as f: f.write(f"cibw-bin={cibw_bin}\n") - f.write(f"bin-path={builder.bin_path}\n") + f.write(f"prepend-path={builder.bin_path if 'uv' in EXTRAS else ''}\n") + print("::endgroup::") EOF shell: bash # Redirecting stderr to stdout to fix interleaving issue in Actions. - - run: > - "${{ steps.cibw.outputs.cibw-bin }}" - "${{ inputs.package-dir }}" - ${{ inputs.output-dir != '' && format('--output-dir "{0}"', inputs.output-dir) || ''}} - ${{ inputs.config-file != '' && format('--config-file "{0}"', inputs.config-file) || ''}} - ${{ inputs.only != '' && format('--only "{0}"', inputs.only) || ''}} - 2>&1 - env: - PATH: ${{ contains(inputs.extras, 'uv') && format('{0}:{1}', steps.cibw.outputs.bin-path, env.PATH) || env.PATH }} + - run: | + prepend_path="${{ steps.cibw.outputs.prepend-path }}" + if [ -n "$prepend_path" ]; then + export PATH="$prepend_path:$PATH" + fi + "${{ steps.cibw.outputs.cibw-bin }}" \ + "${{ inputs.package-dir }}" \ + ${{ inputs.output-dir != '' && format('--output-dir "{0}"', inputs.output-dir) || ''}} \ + ${{ inputs.config-file != '' && format('--config-file "{0}"', inputs.config-file) || ''}} \ + ${{ inputs.only != '' && format('--only "{0}"', inputs.only) || ''}} \ + 2>&1 shell: bash if: runner.os != 'Windows' # Windows needs powershell to interact nicely with Meson - - run: > - & "${{ steps.cibw.outputs.cibw-bin }}" - "${{ inputs.package-dir }}" - ${{ inputs.output-dir != '' && format('--output-dir "{0}"', inputs.output-dir) || ''}} - ${{ inputs.config-file != '' && format('--config-file "{0}"', inputs.config-file) || ''}} - ${{ inputs.only != '' && format('--only "{0}"', inputs.only) || ''}} - env: - PATH: ${{ contains(inputs.extras, 'uv') && format('{0};{1}', steps.cibw.outputs.bin-path, env.PATH) || env.PATH }} + - run: | + $PrependPath = "${{ steps.cibw.outputs.prepend-path }}" + if ($PrependPath) { + $env:PATH = "$PrependPath;$env:PATH" + } + & "${{ steps.cibw.outputs.cibw-bin }}" ` + "${{ inputs.package-dir }}" ` + ${{ inputs.output-dir != '' && format('--output-dir "{0}"', inputs.output-dir) || ''}} ` + ${{ inputs.config-file != '' && format('--config-file "{0}"', inputs.config-file) || ''}} ` + ${{ inputs.only != '' && format('--only "{0}"', inputs.only) || ''}} shell: pwsh if: runner.os == 'Windows'