Skip to content

Publish to PyPI

Publish to PyPI #24

Workflow file for this run

# This workflow will build a Python project and publish it to PyPI using the tag as version number.
name: Publish to PyPI
on: [workflow_dispatch]
jobs:
build-n-publish:
name: Build and publish Python distribution to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: 'pyproject.toml'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build and publish
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
poetry build
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry publish