Skip to content

Publish to PyPI

Publish to PyPI #67

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [ published ]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.9', '3.10', '3.11', '3.12' ]
steps:
- uses: actions/checkout@v4.1.4
- name: Set up Python
uses: actions/setup-python@v5.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pip install poetry
- name: Install dependencies
run: poetry install
- name: Build wheel
run: poetry build --format wheel
# Conditionally build sdist
- name: Build sdist
if: matrix.python-version == '3.9'
run: poetry build --format sdist
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.8.14
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}