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
33 changes: 17 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
# same build + test steps that the `check` job in ci.yml runs.
#
# Publishes abi3 maturin wheels for:
# - linux x86_64 + aarch64 (via QEMU)
# - macOS x86_64 + arm64 (via two native runners, combined into universal2)
# - linux x86_64 + aarch64 (via QEMU / manylinux)
# - macOS universal2 (x86_64 + arm64 combined)
# - windows x86_64
#
# The wheel uses cp39 abi3 (--interpreter python3.9 --abi3) so one wheel covers
# Python 3.9+ on each platform. pyproject.toml declares requires-python = ">=3.11"
# which is still compatible (the abi3 tag is the build ABI floor, not the runtime
# floor — pip enforces pyproject.toml's requires-python separately).
# abi3 is activated by the `pyo3/abi3-py39` crate feature (set in Cargo.toml),
# NOT by a --abi3 / --interpreter CLI flag to maturin. maturin detects the abi3
# feature automatically and stamps the wheel tag `cp39-abi3`.

name: publish

Expand All @@ -24,12 +23,10 @@ on:
inputs:
tag:
description: "Tag to publish (e.g. v0.1.0)"
required: true
required: false

env:
CARGO_TERM_COLOR: always
# maturin needs this to pick the right Python for abi3 builds.
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}

jobs:
# ── Linux x86_64 + aarch64 (manylinux) ───────────────────────────────────
Expand All @@ -44,19 +41,19 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: build wheel (manylinux abi3)
- name: build wheel (manylinux, abi3 via pyo3/abi3-py39 crate feature)
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --features extension-module --interpreter python3.11 --abi3
args: --release --out dist --features extension-module
manylinux: auto
sccache: "true"
- uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.target }}
path: dist

# ── macOS x86_64 + arm64 (combined into universal2) ──────────────────────
# ── macOS universal2 (x86_64 + arm64 combined) ───────────────────────────
macos:
name: macos (universal2)
runs-on: macos-latest
Expand All @@ -65,11 +62,11 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: build wheel (universal2 abi3)
- name: build wheel (universal2, abi3 via pyo3/abi3-py39 crate feature)
uses: PyO3/maturin-action@v1
with:
target: universal2-apple-darwin
args: --release --out dist --features extension-module --interpreter python3.11 --abi3
args: --release --out dist --features extension-module
sccache: "true"
- uses: actions/upload-artifact@v4
with:
Expand All @@ -85,11 +82,11 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: build wheel (abi3)
- name: build wheel (abi3 via pyo3/abi3-py39 crate feature)
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --out dist --features extension-module --interpreter python3.11 --abi3
args: --release --out dist --features extension-module
sccache: "true"
- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -128,8 +125,12 @@ jobs:
pattern: wheels-*
merge-multiple: true
path: dist
- name: list wheels
run: ls -la dist/
- name: publish
uses: PyO3/maturin-action@v1
with:
command: upload
args: --non-interactive --skip-existing dist/*
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
Loading