Skip to content

Commit

Permalink
Get thermopack files in cibuildwheel workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
vegardjervell committed Nov 8, 2024
1 parent 4a6565b commit d8a2239
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ jobs:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]

env:
THERMOPACK_DIR: thermopack-${{ matrix.os }}
THERMOPACK_URL: https://github.com/vegardjervell/thermopack/releases/download/Latest-beta
steps:
- uses: actions/checkout@v4
- name: checkout submodules
Expand All @@ -18,12 +21,28 @@ jobs:
# Used to host cibuildwheel
- uses: actions/setup-python@v4

- name: Install cibuildwheel and other dependencies
run: python -m pip install cibuildwheel==2.17.0 build wheel setuptools
- name: Fetch Thermopack
if: runner.os != 'windows-latest'
run: |
curl -L -o thermopack.zip ${{ env.THERMOPACK_URL }}/thermopack-${{ matrix.os }}.zip
unzip thermopack.zip
export THERMOPACK_DIR=${PWD}/thermopack-${{ matrix.os }}/
curl -L -o thermopack_whl.zip ${{ env.THERMOPACK_URL }}/wheel-v2-${{ matrix.os }}.zip
unzip thermopack_whl.zip
pip install wheel-v2-${{ matrix.os }}/*
- name: Build sdist
run: pipx run build --sdist --outdir wheelhouse
if: runner.os == 'Windows'
- name: Fetch Thermopack (Windows)
if: runner.os == 'windows-latest'
shell: pwsh
run: |
Invoke-WebRequest -Uri "${{ env.THERMOPACK_URL }}/thermopack-${{ matrix.os }}.zip" -OutFile "thermopack.zip"
Expand-Archive -Path "thermopack.zip" -DestinationPath "${{ env.THERMOPACK_DIR }}"
$THERMOPACK_DIR = "$PWD\${{ env.THERMOPACK_DIR }}\thermopack-${{ matrix.os }}"
[System.Environment]::SetEnvironmentVariable("THERMOPACK_DIR", $THERMOPACK_DIR)
Invoke-WebRequest -Uri "${{ env.THERMOPACK_URL }}/wheel-v2-${{ matrix.os }}.zip" -OutFile "thermopack_whl.zip"
Expand-Archive -Path "thermopack_whl.zip" -DestinationPath "wheel-v2-${{ matrix.os }}"
cd wheel-v2-${{ matrix.os }}
pip install (Get-ChildItem wheel-v2-windows-latest\*.whl).FullName
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.1 # run: python -m cibuildwheel --output-dir wheelhouse
Expand Down

0 comments on commit d8a2239

Please sign in to comment.