Skip to content

Publish to PyPI

Publish to PyPI #25

Workflow file for this run

name: Publish to PyPI
on:
push:
tags:
- 'v*'
workflow_run:
workflows: ["Test UV Installation Detection"]
types: [completed]
branches: [main]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
environment: release
# Only run if tests passed (when triggered by workflow_run) or when manually triggered/tagged
if: |
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
permissions:
id-token: write # Required for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python
run: uv python install
- name: Build package
run: uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1