Skip to content

Publish Python distribution #39

Publish Python distribution

Publish Python distribution #39

Workflow file for this run

name: PyPI Publish
on:
release:
types: [published]
workflow_dispatch:
inputs:
test_release:
description: If true, publish to test.pypi.org
required: true
default: true
type: boolean
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv & Python
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- run: uv build
- name: Publish to TestPyPI
if: ${{ github.event_name == 'workflow_dispatch' && inputs.test_release == true }}
run: uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
UV_PUBLISH_URL: https://test.pypi.org/legacy/
- name: Publish to PyPI
if: ${{ github.event_name != 'workflow_dispatch' || inputs.test_release == false }}
run: uv publish
env:
UV_PUBLISH_TOKEN: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}