Skip to content

Commit eaf93b9

Browse files
SAKMZclaude
andcommitted
ci: add PyPI Trusted Publishing workflow
Publishes to PyPI via OIDC on GitHub Release (or manual dispatch); no token. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 605f40e commit eaf93b9

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: publish
2+
3+
# Publishes to PyPI via Trusted Publishing (OIDC) -- no API token needed.
4+
# Fires when you publish a GitHub Release, or run it manually.
5+
on:
6+
release:
7+
types: [published]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.x"
18+
- name: Build sdist and wheel
19+
run: |
20+
python -m pip install --upgrade build
21+
python -m build
22+
- name: Check metadata
23+
run: |
24+
python -m pip install --upgrade twine
25+
python -m twine check dist/*
26+
- uses: actions/upload-artifact@v4
27+
with:
28+
name: dist
29+
path: dist/
30+
31+
publish:
32+
needs: build
33+
runs-on: ubuntu-latest
34+
environment: pypi # optional: add protection rules to this env
35+
permissions:
36+
id-token: write # required for Trusted Publishing (OIDC)
37+
steps:
38+
- uses: actions/download-artifact@v4
39+
with:
40+
name: dist
41+
path: dist/
42+
- name: Publish to PyPI
43+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)