Bump version to 0.12.8 #127
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 & Release Python Wheels (Selected Platforms) | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # Trigger on version tags like v1.0.0 | |
workflow_dispatch: # Allow manual triggering | |
permissions: | |
id-token: write | |
contents: read | |
attestations: write | |
env: | |
MACOSX_DEPLOYMENT_TARGET: "13.0" | |
jobs: | |
linux-x64: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Linux dependencies | |
run: bash scripts/install_linux_deps.sh | |
- name: Set up Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
cache: true | |
target: x86_64-unknown-linux-gnu | |
rustflags: "" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
architecture: x64 | |
- name: Generate stubs | |
run: | | |
cargo run --bin stub_gen | |
working-directory: bindings/python | |
- name: Build wheels with system deps | |
uses: PyO3/maturin-action@v1 | |
with: | |
working-directory: bindings/python | |
target: x86_64 | |
manylinux: '2_34' | |
args: --release --strip --out dist | |
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
before-script-linux: | | |
dnf install -y epel-release | |
dnf install -y \ | |
pipewire-devel \ | |
libxkbcommon-devel \ | |
systemd-devel \ | |
dbus-devel \ | |
openssl-devel \ | |
mesa-libEGL-devel \ | |
mesa-libgbm-devel \ | |
clang-devel \ | |
llvm-devel \ | |
wayland-devel | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-linux-x86_64 | |
path: bindings/python/dist | |
windows-x64: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
cache: true | |
target: x86_64-pc-windows-msvc | |
rustflags: "" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
architecture: x64 | |
- name: Generate stubs | |
run: | | |
cargo run --bin stub_gen | |
working-directory: bindings/python | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
working-directory: bindings/python | |
target: x64 | |
args: --release --strip --out dist | |
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-windows-x64 | |
path: bindings/python/dist | |
windows-arm64: | |
runs-on: windows-11-arm | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
cache: true | |
target: aarch64-pc-windows-msvc | |
rustflags: "" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
architecture: arm64 | |
- name: Generate stubs | |
run: | | |
cargo run --bin stub_gen | |
working-directory: bindings/python | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
working-directory: bindings/python | |
target: aarch64 | |
args: --release --strip --out dist | |
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-windows-arm64 | |
path: bindings/python/dist | |
macos-x64: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
cache: true | |
target: x86_64-apple-darwin | |
rustflags: "" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Generate stubs | |
run: | | |
RUSTFLAGS="-C link-arg=-undefined -C link-arg=dynamic_lookup" cargo run --bin stub_gen | |
working-directory: bindings/python | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
working-directory: bindings/python | |
target: x86_64 | |
args: --release --strip --out dist | |
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-macos-x86_64 | |
path: bindings/python/dist | |
macos-arm64: | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
cache: true | |
target: aarch64-apple-darwin | |
rustflags: "" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Generate stubs | |
run: | | |
RUSTFLAGS="-C link-arg=-undefined -C link-arg=dynamic_lookup" cargo run --bin stub_gen | |
working-directory: bindings/python | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
working-directory: bindings/python | |
target: aarch64 | |
args: --release --strip --out dist | |
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
- name: Upload wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-macos-arm64 | |
path: bindings/python/dist | |
sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
uses: PyO3/maturin-action@v1 | |
with: | |
working-directory: bindings/python | |
command: sdist | |
args: --out dist | |
- name: Upload sdist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-sdist | |
path: bindings/python/dist | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} | |
needs: [windows-x64, windows-arm64, linux-x64, macos-x64, macos-arm64] | |
permissions: | |
id-token: write | |
contents: write | |
attestations: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: bindings/python/ | |
- name: Generate artifact attestation | |
uses: actions/attest-build-provenance@v2 | |
with: | |
subject-path: 'bindings/python/wheels-*/*.whl' | |
- name: Publish to PyPI | |
uses: PyO3/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
working-directory: bindings/python | |
command: upload | |
args: --non-interactive --skip-existing wheels-sdist/* wheels-windows-x64/* wheels-windows-arm64/* wheels-linux-x86_64/* wheels-macos-x86_64/* wheels-macos-arm64/* |