Build and release wheels #219
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 release wheels | |
| on: | |
| merge_group: | |
| types: [ checks_requested ] | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "v*" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| pypi_linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| args: --release --out dist --compatibility pypi | |
| manylinux: auto | |
| working-directory: pyo3-introspection | |
| - uses: astral-sh/setup-uv@v8.1.0 | |
| - run: uvx twine check pyo3-introspection/dist/* | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheels-linux-${{ matrix.target }} | |
| path: pyo3-introspection/dist | |
| pypi_windows: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - runner: windows-latest | |
| target: x64 | |
| - runner: windows-latest | |
| target: x86 | |
| - runner: windows-11-arm | |
| target: aarch64 | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.platform.target }} | |
| args: --release --out dist --compatibility pypi | |
| working-directory: pyo3-introspection | |
| - uses: astral-sh/setup-uv@v8.1.0 | |
| - run: uvx twine check pyo3-introspection/dist/* | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheels-windows-${{ matrix.platform.target }} | |
| path: pyo3-introspection/dist | |
| pypi_macos: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - runner: macos-15-intel | |
| target: x86_64 | |
| - runner: macos-latest | |
| target: aarch64 | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.platform.target }} | |
| args: --release --out dist --compatibility pypi | |
| working-directory: pyo3-introspection | |
| - uses: astral-sh/setup-uv@v8.1.0 | |
| - run: uvx twine check pyo3-introspection/dist/* | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheels-macos-${{ matrix.platform.target }} | |
| path: pyo3-introspection/dist | |
| pypi_sdist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: PyO3/maturin-action@v1 | |
| with: | |
| command: sdist | |
| args: --out dist | |
| working-directory: pyo3-introspection | |
| - uses: astral-sh/setup-uv@v8.1.0 | |
| - run: uvx twine check pyo3-introspection/dist/* | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheels-sdist | |
| path: pyo3-introspection/dist | |
| pypi_release: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| permissions: | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| environment: release | |
| needs: [pypi_linux, pypi_windows, pypi_macos, pypi_sdist] | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| pattern: wheels-* | |
| path: pyo3-introspection/dist | |
| merge-multiple: true | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: pyo3-introspection/dist |