Skip to content

2.0.0

2.0.0 #8

Workflow file for this run

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: Checkout (official GitHub action)
uses: actions/checkout@v6
with:
# Important for versioning plugins:
fetch-depth: 0
- name: Install uv (official Astral action)
uses: astral-sh/setup-uv@v7
with:
version: "0.9.25"
enable-cache: true
python-version: "3.12"
- name: Set up Python (using uv)
run: uv python install
- name: Install all dependencies
run: uv sync --all-extras
- name: Run tests
run: uv run pytest
- name: Build package
run: uv build
- name: Publish to PyPI
run: uv publish --trusted-publishing always
# Although uv is newer and faster, the "official" publishing option is the one from PyPA,
# which uses twine. If desired, replace `uv publish` with:
# uses: pypa/gh-action-pypi-publish@release/v1