Skip to content

Commit 2fbbcf6

Browse files
nhortonclaude
andauthored
Add PyPI release workflow with trusted publishing (#20)
Adds GitHub Actions workflow that publishes to PyPI when a release is created. Uses OIDC trusted publishing (no API tokens needed). Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f856d32 commit 2fbbcf6

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Install uv
14+
uses: astral-sh/setup-uv@v4
15+
with:
16+
version: "latest"
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.11"
22+
23+
- name: Install dependencies
24+
run: uv sync --extra dev
25+
26+
- name: Run tests
27+
run: uv run pytest tests/ -v
28+
29+
- name: Build package
30+
run: uv build
31+
32+
- name: Upload dist artifacts
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: dist
36+
path: dist/
37+
38+
publish:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
environment: pypi
42+
permissions:
43+
id-token: write
44+
steps:
45+
- name: Download dist artifacts
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: dist
49+
path: dist/
50+
51+
- name: Publish to PyPI
52+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)