Skip to content

Commit 67fd656

Browse files
Technologicatclaude
andcommitted
CI: add automated PyPI publishing on tag push
Uses trusted publishers (OIDC). Triggers on v* tags after tests pass. Requires one-time trusted publisher setup on PyPI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0b8ffde commit 67fd656

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ name: Python package
88
on:
99
push:
1010
branches: [ master ]
11+
tags: ["v*"]
1112
pull_request:
1213
branches: [ master ]
1314
workflow_dispatch:
@@ -68,3 +69,35 @@ jobs:
6869
pdm use --venv in-project
6970
source .venv/bin/activate
7071
python runtests.py
72+
73+
build-dist:
74+
needs: test
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v6
78+
- uses: actions/setup-python@v6
79+
with:
80+
python-version: "3.14"
81+
- run: pip install build
82+
- run: python -m build
83+
- uses: actions/upload-artifact@v7
84+
with:
85+
name: dist
86+
path: dist/
87+
88+
publish:
89+
if: startsWith(github.ref, 'refs/tags/v')
90+
needs: build-dist
91+
runs-on: ubuntu-latest
92+
environment: pypi
93+
permissions:
94+
id-token: write
95+
steps:
96+
- uses: actions/download-artifact@v4
97+
with:
98+
name: dist
99+
path: dist/
100+
101+
- uses: pypa/gh-action-pypi-publish@release/v1
102+
with:
103+
packages-dir: dist/

0 commit comments

Comments
 (0)