Skip to content

Publish to PyPI

Publish to PyPI #23

Workflow file for this run

name: Publish to PyPI
on:
workflow_dispatch:
inputs:
repository:
description: "Target repository (pypi or test)"
required: true
default: "pypi"
jobs:
publish:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install uv
run: curl -LsSf https://astral.sh/uv/0.9.8/install.sh | sh
- name: Build package with uv
run: uv build
- name: Publish to Test PyPI
if: github.event.inputs.repository == 'test'
env:
UV_PUBLISH_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
run: uv publish --token $UV_PUBLISH_TOKEN --publish-url https://test.pypi.org/legacy/
- name: Publish to Regular PyPI
if: github.event.inputs.repository == 'pypi'
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: uv publish --token $UV_PUBLISH_TOKEN