Skip to content

Commit 283bacb

Browse files
GeneAIclaude
authored andcommitted
ci: Add PyPI trusted publisher workflow
Enables secure tokenless publishing via OIDC: - Triggers on GitHub release published - Builds wheel and sdist - Publishes using trusted publisher (no API token) Requires configuring trusted publisher on PyPI: - Owner: Smart-AI-Memory - Repo: empathy-framework - Workflow: publish-pypi.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 836843b commit 283bacb

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish 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: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.11'
17+
18+
- name: Install build dependencies
19+
run: pip install build
20+
21+
- name: Build package
22+
run: python -m build
23+
24+
- name: Upload artifacts
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: dist
28+
path: dist/
29+
30+
publish:
31+
needs: build
32+
runs-on: ubuntu-latest
33+
environment: pypi
34+
permissions:
35+
id-token: write # Required for trusted publishing
36+
steps:
37+
- name: Download artifacts
38+
uses: actions/download-artifact@v4
39+
with:
40+
name: dist
41+
path: dist/
42+
43+
- name: Publish to PyPI
44+
uses: pypa/gh-action-pypi-publish@release/v1
45+
# No token needed - uses OIDC trusted publishing

0 commit comments

Comments
 (0)