CI build wheels #140
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI build wheels | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: | |
| - released | |
| jobs: | |
| build_wheels: | |
| name: Wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, windows-11-arm, macos-15-intel, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: (windows-x86_64) Install rtools MinGW compilers | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| choco install rtools -y --no-progress --force --version=4.0.0.20220206 | |
| - name: (windows-arm64) Install LLVM for Windows ARM64 | |
| if: matrix.os == 'windows-11-arm' | |
| shell: pwsh | |
| run: | | |
| Invoke-WebRequest https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.8/LLVM-20.1.8-woa64.exe -UseBasicParsing -OutFile LLVM-woa64.exe | |
| Start-Process -FilePath ".\LLVM-woa64.exe" -ArgumentList "/S" -Wait | |
| echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| echo "CC=clang-cl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| echo "FC=flang-new" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| echo "AR=llvm-ar" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: (macos-13) Ensure gfortran is in path | |
| if: matrix.os == 'macos-15-intel' | |
| run: | | |
| sudo ln -s /usr/local/bin/gfortran-13 /usr/local/bin/gfortran | |
| which gfortran | |
| gfortran --version | |
| - name: (macos-latest) Ensure gfortran is in path | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| sudo ln -s /opt/homebrew/bin/gfortran-13 /opt/homebrew/bin/gfortran | |
| which gfortran | |
| gfortran --version | |
| - name: Build wheels for CPython | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.os }} | |
| path: ./wheelhouse/*.whl | |
| build_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| name: Install Python | |
| with: | |
| python-version: '3.12' | |
| - name: Build sdist | |
| run: | | |
| pip install build | |
| python -m build -s . | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: ./dist/*.tar.gz | |
| upload_pypi: | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-latest | |
| # to publish when a GitHub Release is created: | |
| if: github.event_name == 'release' && github.event.action == 'released' | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Display structure of downloaded files | |
| run: ls -lR dist | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_TOKEN }} | |
| # repository_url: https://test.pypi.org/legacy/ |