Skip to content

Publish to PyPI

Publish to PyPI #5

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [created]
workflow_dispatch:
permissions:
id-token: write # REQUIRED for trusted publishing
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.13"
- name: Request OIDC Token
run: |
curl -X POST \
-H "Authorization: Bearer $(curl -X POST -H \"Authorization: token ${{ secrets.GITHUB_TOKEN }}\" \
https://api.github.com/app/installations/YOUR_INSTALLATION_ID/access_tokens | jq -r .token)" \
https://pypi.org/_/oidc/token
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Configure Poetry
run: poetry config pypi-token.pypi ""
- name: Build package
run: poetry build
- name: Publish to PyPI
run: poetry publish