Skip to content

Publish to PyPI

Publish to PyPI #6

Workflow file for this run

name: Publish to PyPI
on:
workflow_dispatch:
permissions:
id-token: write # Required for OpenID Connect authentication
contents: read
jobs:
publish:
name: Publish Python Package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: Gr1N/setup-poetry@v8
- uses: actions/cache@v2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- run: poetry --version
- run: poetry install
- run: poetry build
- name: Publish to PyPI using Trusted Publisher
env:
POETRY_HTTP_BASIC_PYPI_USERNAME: __token__
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: poetry publish