Skip to content

Publish to PyPI

Publish to PyPI #1

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
workflow_dispatch: # Allow manual triggering
jobs:
build-and-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
contents: read # This is required for actions/checkout
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build dependencies
run: python -m pip install --upgrade pip build twine
- name: Build Python Package (sdist and wheel)
run: python -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1