Skip to content

action

action #17

Workflow file for this run

name: Build and Publish
on:
push:
tags:
- 'v*'
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.8]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
args: --release --out dist --target ${{ matrix.target }} --find-interpreter
sccache: 'true'
manylinux: auto
env:
MACOSX_DEPLOYMENT_TARGET: '10.9'
- name: Build universal wheel
if: matrix.os == 'ubuntu-latest'
uses: PyO3/maturin-action@v1
with:
args: --release --out dist --compatibility manylinux2014 --find-interpreter
sccache: 'true'
- name: Build sdist
if: matrix.os == 'ubuntu-latest'
uses: PyO3/maturin-action@v1
with:
args: --release --sdist --out dist
sccache: 'true'
- uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
publish:
name: Publish to PyPI
needs: [build_wheels]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true