Skip to content

Publish to PyPI

Publish to PyPI #4

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "pyproject.toml uv.lock"
- name: Install dependencies
run: uv sync --all-groups
- name: Run tests
run: uv run pytest
- name: Build package
run: uv build --sdist --wheel --out-dir dist
- name: Publish to PyPI
run: uv publish -t ${{ secrets.PYPI_API_TOKEN }}
- name: Minimize uv cache
run: uv cache prune --ci