Fix PATH manipulation in action.yml

This commit is contained in:
Joe Rickerby
2025-12-21 16:05:43 +00:00
parent bc79c16a71
commit 355c5a46b2
+21 -16
View File
@@ -75,32 +75,37 @@ runs:
with open(os.environ["GITHUB_OUTPUT"], "at") as f: with open(os.environ["GITHUB_OUTPUT"], "at") as f:
f.write(f"cibw-bin={cibw_bin}\n") 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::") print("::endgroup::")
EOF EOF
shell: bash shell: bash
# Redirecting stderr to stdout to fix interleaving issue in Actions. # Redirecting stderr to stdout to fix interleaving issue in Actions.
- run: > - run: |
"${{ steps.cibw.outputs.cibw-bin }}" prepend_path="${{ steps.cibw.outputs.prepend-path }}"
"${{ inputs.package-dir }}" if [ -n "$prepend_path" ]; then
${{ inputs.output-dir != '' && format('--output-dir "{0}"', inputs.output-dir) || ''}} export PATH="$prepend_path:$PATH"
${{ inputs.config-file != '' && format('--config-file "{0}"', inputs.config-file) || ''}} fi
${{ inputs.only != '' && format('--only "{0}"', inputs.only) || ''}} "${{ 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 2>&1
env:
PATH: ${{ contains(inputs.extras, 'uv') && format('{0}:{1}', steps.cibw.outputs.bin-path, env.PATH) || env.PATH }}
shell: bash shell: bash
if: runner.os != 'Windows' if: runner.os != 'Windows'
# Windows needs powershell to interact nicely with Meson # Windows needs powershell to interact nicely with Meson
- run: > - run: |
& "${{ steps.cibw.outputs.cibw-bin }}" $PrependPath = "${{ steps.cibw.outputs.prepend-path }}"
"${{ inputs.package-dir }}" if ($PrependPath) {
${{ inputs.output-dir != '' && format('--output-dir "{0}"', inputs.output-dir) || ''}} $env:PATH = "$PrependPath;$env:PATH"
${{ inputs.config-file != '' && format('--config-file "{0}"', inputs.config-file) || ''}} }
& "${{ 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) || ''}} ${{ 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 }}
shell: pwsh shell: pwsh
if: runner.os == 'Windows' if: runner.os == 'Windows'