WHL: build limited-api compliant wheels #184
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: Wheels | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build_bdist: | |
| name: "Build ${{ matrix.os }} (${{ matrix.arch }}) wheels" | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 # should be long enough even on tags, but let's prevent hangs | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| - os: ubuntu-22.04-arm | |
| - os: windows-2022 | |
| - os: macos-14 | |
| - os: macos-15-intel | |
| - os: windows-11-arm | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| # For aarch64 support | |
| # https://cibuildwheel.pypa.io/en/stable/faq/#emulation | |
| #- uses: docker/setup-qemu-action@v3 | |
| # with: | |
| # platforms: all | |
| # if: runner.os == 'Linux' && matrix.arch == 'aarch64' | |
| - name: "Building ${{ matrix.os }} wheels" | |
| if: matrix.os != 'windows-2022' | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| - name: "Building Windows AMD64 wheels" | |
| if: matrix.os == 'windows-2022' | |
| uses: pypa/cibuildwheel@v3.3.1 | |
| env: | |
| CIBW_ARCHS: native | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: pypi-artifacts-${{ matrix.os }}-${{ matrix.arch }} | |
| path: ${{ github.workspace }}/wheelhouse/*.whl | |
| build_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Build sdist | |
| run: > | |
| pip install build | |
| && python -m build --sdist . --outdir dist | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: pypi-artifacts | |
| path: ${{ github.workspace }}/dist/*.tar.gz | |
| show-artifacts: | |
| needs: [build_bdist, build_sdist] | |
| name: "Show artifacts" | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| pattern: pypi-artifacts* | |
| path: ${{ github.workspace }}/dist | |
| merge-multiple: true | |
| - shell: bash | |
| run: | | |
| ls -l ${{ github.workspace }}/dist | |
| publish-artifacts-pypi: | |
| needs: [build_bdist, build_sdist] | |
| name: "Publish to PyPI" | |
| runs-on: ubuntu-22.04 | |
| # upload to PyPI for every tag starting with 'v' | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| pattern: pypi-artifacts* | |
| path: ${{ github.workspace }}/dist | |
| merge-multiple: true | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_PASSWORD }} | |
| print_hash: true |