Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions .github/workflows/publish-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ on:
- 'v*'

jobs:
build:
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# macos-latest is arm64 on GitHub Actions now; macos-13 is the last Intel runner.
# Keep both so we ship wheels for Apple Silicon and Intel Macs.
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4
Expand All @@ -29,11 +32,15 @@ jobs:
3.10
3.11
3.12
3.13

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist
# -i enumerates interpreters maturin should build for. Without this,
# maturin builds for whichever python3 happens to be on PATH (one
# cp version per OS) — the root cause of the 0.9.3 / 0.10.0 wheel gap.
args: --release --out dist -i python3.10 python3.11 python3.12 python3.13
sccache: 'true'
manylinux: auto

Expand All @@ -43,21 +50,44 @@ jobs:
name: wheels-${{ matrix.os }}
path: dist

build-sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist

release:
name: Release
runs-on: ubuntu-latest
needs: [build]
needs: [build-wheels, build-sdist]
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true

- uses: actions/download-artifact@v4
with:
name: sdist
path: dist

- name: Publish to PyPI
uses: PyO3/maturin-action@v1
with:
command: upload
args: --non-interactive --skip-existing dist/*
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
Loading