Skip to content
This repository was archived by the owner on Jul 5, 2026. It is now read-only.

Publish to PyPI

Publish to PyPI #19

Workflow file for this run

name: Publish to PyPI
on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish (must match pyproject.toml, e.g. 0.0.4)'
required: true
type: string
jobs:
build:
name: 'Build and upload wheels'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 100
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: 'latest'
- name: Set up Python
run: uv python install 3.12
- name: Verify version matches
run: |
PROJECT_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
if [ "$PROJECT_VERSION" != "${{ github.event.inputs.version }}" ]; then
echo "Error: Input version (${{ github.event.inputs.version }}) does not match pyproject.toml version ($PROJECT_VERSION)"
exit 1
fi
- name: Install development dependencies
run: uv sync --group dev
- name: Build project
run: uv build
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
path: ./dist
publish-to-pypi:
name: 'Publish to PyPI'
runs-on: ubuntu-latest
needs: [build]
environment:
name: pypi
url: https://pypi.org/p/pipecat-ai-flows
permissions:
id-token: write
contents: write # Needed for tagging
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-tags: true
fetch-depth: 100
- name: Create release tag
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git tag -a "v${{ github.event.inputs.version }}" -m "Version ${{ github.event.inputs.version }}"
git push origin "v${{ github.event.inputs.version }}"
- name: Download wheels
uses: actions/download-artifact@v4
with:
name: wheels
path: ./dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
print-hash: true