Skip to content

Publish

Publish #14

Workflow file for this run

name: Publish
on:
release:
types: [published]
jobs:
build:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Build wheels
uses: pypa/[email protected]
env:
# Skip CPython 3.6 and CPython 3.7
CIBW_SKIP: cp36-* cp37-* pp*
- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}-${{ matrix.python-version }}
path: ./wheelhouse/*.whl
pypi-publish:
needs: ['build']
environment: 'publish'
name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/download-artifact@v4
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: artifact/