Publish to PyPI #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |