Skip to content

0.5.0

0.5.0 #15

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
permissions:
contents: read
env:
# Strip leading 'v' if present (v0.2.0 → 0.2.0)
RAW_VERSION: ${{ github.event.release.tag_name }}
PYTHON_VERSIONS: "3.9 3.10 3.11 3.12 3.13 3.14"
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
allow-prereleases: true
- name: Set version from tag
run: |
VERSION="${RAW_VERSION#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" Cargo.toml
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist -i python3.9 python3.10 python3.11 python3.12 python3.13 python3.14
manylinux: auto
- uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.target }}
path: dist
build-macos:
runs-on: macos-latest
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: |
3.9
3.10
3.11
3.12
3.13
3.14
allow-prereleases: true
- name: Set version from tag
run: |
VERSION="${RAW_VERSION#v}"
sed -i '' "s/^version = .*/version = \"$VERSION\"/" Cargo.toml
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist -i python3.9 python3.10 python3.11 python3.12 python3.13 python3.14
- uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.target }}
path: dist
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: |
3.9
3.10
3.11
3.12
3.13
3.14
allow-prereleases: true
- name: Set version from tag
shell: bash
run: |
VERSION="${RAW_VERSION#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" Cargo.toml
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --out dist -i python3.9 python3.10 python3.11 python3.12 python3.13 python3.14
- uses: actions/upload-artifact@v4
with:
name: wheels-windows-x86_64
path: dist
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set version from tag
run: |
VERSION="${RAW_VERSION#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" Cargo.toml
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist
publish-pypi:
needs: [build-linux, build-macos, build-windows, sdist]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1