Publish to PyPI #1
Workflow file for this run
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
name: Publish to PyPI | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: # Enable manual trigger. | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # Mandatory for OIDC. | |
contents: read | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
with: | |
# Important for versioning plugins: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: latest | |
- name: Install Poetry plugins | |
run: | | |
poetry self add "poetry-dynamic-versioning[plugin]" | |
- name: Install dependencies | |
run: poetry install --no-root | |
- name: Generate README.md | |
run: python devtools/generate_readme.py | |
- name: Build package | |
run: poetry build | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |