Skip to content

Commit 204f56a

Browse files
Patrick Roebuckclaude
andcommitted
ci: Add trusted publisher workflow for PyPI
Add GitHub Actions workflow for automated PyPI publishing using Trusted Publishers (OIDC authentication). Workflow triggers on GitHub releases and automatically: - Builds the package - Validates with twine check - Publishes to PyPI using trusted publishing No API tokens required - uses GitHub OIDC. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 744fcc3 commit 204f56a

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
publish:
12+
name: Publish to PyPI
13+
runs-on: ubuntu-latest
14+
environment:
15+
name: pypi
16+
url: https://pypi.org/p/memdocs
17+
permissions:
18+
id-token: write # Required for trusted publishing
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.10"
27+
28+
- name: Install build dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install build twine
32+
33+
- name: Build package
34+
run: python -m build
35+
36+
- name: Check package
37+
run: twine check dist/*
38+
39+
- name: Publish to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)