Skip to content

Commit

Permalink
Update action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Jan 30, 2024
1 parent 841ab1b commit 5c3e5cb
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,27 @@ runs:
python-version: "3.8 - 3.12"
update-environment: false

- id: pipx-unix
- id: pipx
run: |
'${{ steps.python.outputs.python-path }}' -m venv --without-pip '${{ runner.temp }}/pipx4cibw'
'${{ steps.python.outputs.python-path }}' -m pip --python '${{ runner.temp }}/pipx4cibw/bin/python' install pipx
echo 'pipx-path=${{ runner.temp }}/pipx4cibw/bin/pipx' >> $GITHUB_OUTPUT
shell: bash
if: runner.os != 'Windows'
import os
import sys
- id: pipx-win
run: |
"${{ steps.python.outputs.python-path }}" -m venv --without-pip "${{ runner.temp }}\pipx4cibw"
"${{ steps.python.outputs.python-path }}" -m pip --python "${{ runner.temp }}\pipx4cibw\Scripts\python.exe" install pipx
echo "pipx-path=${{ runner.temp }}\pipx4cibw\Scripts\pipx.exe" >> $GITHUB_OUTPUT
shell: pwsh
if: runner.os == 'Windows'
from pathlib import Path
from subprocess import run
bin = "Scripts" if sys.platform == "win32" else "bin"
ext = ".exe" if sys.platform == "win32" else "bin"
temp = Path(r"${{ runner.temp }}")
run([sys.executable, "-m", "venv", "--without-pip", str(temp / "pipx4cibw")], check=True)
run([sys.executable, "-m", "pip", "--python", str(temp / "pipx4cibw" / bin / f"python{ext}"), "install", "pipx"], check=True)
pipx_path = temp / "pipx4cibw" / bin / f"pipx{ext}"
with open(os.environ["GITHUB_OUTPUT"], "at") as f:
f.write(f"pipx-path={pipx_path}\n")
shell: ${{ steps.python.outputs.python-path }} {0}

# Redirecting stderr to stdout to fix interleaving issue in Actions.
- run: >
'${{ steps.pipx-unix.outputs.pipx-path }}' run
'${{ steps.pipx.outputs.pipx-path }}' run
--python '${{ steps.python.outputs.python-path }}'
--spec '${{ github.action_path }}'
cibuildwheel
Expand All @@ -63,7 +65,7 @@ runs:
# Windows needs powershell to interact nicely with Meson
- run: >
"${{ steps.pipx-win.outputs.pipx-path }}" run
"${{ steps.pipx.outputs.pipx-path }}" run
--python "${{ steps.python.outputs.python-path }}"
--spec "${{ github.action_path }}"
cibuildwheel
Expand Down

0 comments on commit 5c3e5cb

Please sign in to comment.