v0.1.12 #10
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 | |
on: | |
release: | |
types: [published] | |
permissions: | |
contents: write | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
# This permission is used for trusted publishing: | |
# https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ | |
# | |
# Trusted publishing has to also be configured on PyPI for each package: | |
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/ | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install poetry | |
run: pip install -U poetry | |
- name: Configure poetry | |
run: | | |
poetry config virtualenvs.create true | |
poetry config virtualenvs.in-project true | |
poetry config installer.parallel true | |
poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}" | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
run: poetry install --no-interaction | |
- name: Build using poetry | |
run: poetry build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |