Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: publish

# PILOT-203: PyPI publish workflow.
#
# Triggers on:
# - Release published (the normal path: tag a release on GitHub → publish)
# - workflow_dispatch (manual fallback when a release was created but
# publish missed it, or when republishing on a fresh PYPI_API_TOKEN)
#
# Required secret:
# PYPI_API_TOKEN — pypi.org token scoped to the pilotprotocol project.

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: Build wheel + sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install --upgrade build twine
- run: python -m build
- run: python -m twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 7

publish:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
# OIDC for trusted publisher (preferred). Falls back to API token
# when configured below.
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
Loading