Skip to content

Pyproject toml

Pyproject toml #48

Workflow file for this run

name: Build and publish wheels
on:
push:
tags:
- "v*.*.*" # Only run on version tags like v0.1.0
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] # Supported Python versions
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install maturin
run: |
python -m pip install --upgrade pip
pip install maturin
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Publish to PyPI on macOS and Linux
if: runner.os != 'Windows'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
maturin publish --skip-existing --username __token__
- name: Publish to PyPI on Windows
if: runner.os == 'Windows'
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
# Install Visual Studio Build Tools for Rust on Windows
choco install visualstudio2019buildtools --version=16.11.7
maturin publish --skip-existing --username __token__
build-arm:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] # Supported Python versions
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Zig
uses: korandoru/setup-zig@v1
with:
zig-version: 0.10.1
- name: Install additional target
run: rustup target add aarch64-unknown-linux-gnu
- name: Install maturin
run: pip install maturin
- name: Build and publish
env:
MATURIN_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
maturin publish --username __token__ --password $MATURIN_PASSWORD --target aarch64-unknown-linux-gnu --zig -i python ${{ matrix.python-version }} --skip-existing