Build #52
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 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| wheel_versions: | |
| description: Wheel versions to build | |
| required: true | |
| default: cp37* cp38* cp39* cp310* cp311* cp312* cp313* cp314* | |
| cibw_enable: | |
| description: Non-default builds | |
| cibw_skip: | |
| description: Builds to skip | |
| default: cp3??t-* | |
| publish: | |
| description: Publish wheels | |
| required: true | |
| type: boolean | |
| jobs: | |
| make_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| submodules: recursive | |
| - name: Build source distribution | |
| run: pipx run build --sdist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} (${{ matrix.archs }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| archs: auto | |
| - os: ubuntu-latest | |
| archs: aarch64 | |
| - os: ubuntu-latest | |
| archs: armv7l | |
| - os: ubuntu-latest | |
| archs: ppc64le | |
| - os: ubuntu-latest | |
| archs: s390x | |
| - os: windows-latest | |
| archs: auto | |
| - os: macos-13 | |
| archs: auto | |
| - os: macos-latest | |
| archs: auto | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| submodules: recursive | |
| - name: Set up QEMU | |
| if: runner.os == 'Linux' && runner.arch == 'X64' && matrix.archs != 'auto' | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: all | |
| - name: Build wheels | |
| uses: pypa/[email protected] | |
| env: | |
| CIBW_ARCHS: ${{ matrix.archs }} | |
| CIBW_BUILD: ${{ inputs.wheel_versions }} | |
| CIBW_ENABLE: ${{ inputs.cibw_enable }} | |
| CIBW_SKIP: ${{ inputs.cibw_skip }} | |
| CIBW_TEST_REQUIRES: 'pytest>=7.4.4' | |
| CIBW_TEST_COMMAND: 'pytest --config-file {project}/pyproject.toml {project}/tests' | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheel-${{ matrix.os }}-${{ matrix.archs }} | |
| path: ./wheelhouse/*.whl | |
| upload_wheels: | |
| name: Upload wheels to PyPI | |
| if: ${{ inputs.publish }} | |
| needs: [build_wheels, make_sdist] | |
| environment: release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| pattern: wheel-* | |
| merge-multiple: true | |
| - name: Publish package | |
| uses: pypa/[email protected] |