Build for limited API only on supported interpreters #134
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: Build and upload to PyPI | |
| on: | |
| push: | |
| branches: | |
| - default | |
| # To simplify the release process, the publishing is triggered on tag. | |
| # We should make sure to only push tags for new releases. | |
| # If we start using tags for non-release purposes, | |
| # this needs to be updated. | |
| # | |
| # We need to explicitly configure an expression that matches anything. | |
| tags: [ "**" ] | |
| pull_request: | |
| defaults: | |
| run: | |
| # Use bash on Windows for consistency. | |
| shell: bash | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v4 | |
| name: Install Python | |
| with: | |
| python-version: '3.14' | |
| - name: Install deps | |
| run: | | |
| python -m pip install cibuildwheel==3.2.1 abi3audit==0.0.22 | |
| - name: Build wheels | |
| run: | | |
| python -m cibuildwheel --output-dir wheelhouse | |
| - name: Check files | |
| run: ls -al wheelhouse/ | |
| - name: Audit ABI3 wheels | |
| run: | | |
| abi3audit -vsS wheelhouse/*abi3*.whl | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact-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@v4 | |
| name: Install Python | |
| with: | |
| python-version: '3.9' | |
| - name: Install build | |
| run: | | |
| python -m pip install build | |
| - name: Build sdist | |
| run: python -m build --sdist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: artifact-sdist | |
| path: dist/*.tar.gz | |
| upload_pypi: | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # IMPORTANT: this permission is mandatory for trusted publishing | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: artifact-* | |
| merge-multiple: true | |
| path: dist | |
| - name: Check files | |
| run: ls -al dist/ | |
| - name: Publish to PyPI - on tag | |
| # Skip upload to PyPI if we don't have a tag | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: pypa/gh-action-pypi-publish@release/v1 |