Skip to content

Commit ea9f89b

Browse files
SAKMZclaude
andcommitted
Add auto-publish workflow and bump CI actions
- Add publish.yml: builds and publishes to PyPI on GitHub Release, using Trusted Publishing (OIDC) so no API token is stored in the repo - Bump actions/checkout to v5 and setup-python to v6 in ci.yml to resolve the Node.js 20 deprecation warning Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 81d134b commit ea9f89b

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1616

1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1919

2020
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v5
21+
uses: actions/setup-python@v6
2222
with:
2323
python-version: ${{ matrix.python-version }}
2424

‎.github/workflows/publish.yml‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish to PyPI
2+
3+
# Publishes to PyPI whenever a GitHub Release is published.
4+
# Uses PyPI Trusted Publishing (OIDC) - no API token is stored in the repo.
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
build:
11+
name: Build distributions
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v5
15+
- uses: actions/setup-python@v6
16+
with:
17+
python-version: "3.12"
18+
- name: Build sdist and wheel
19+
run: |
20+
python -m pip install --upgrade build
21+
python -m build
22+
- name: Check with twine
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+
name: Publish to PyPI
33+
needs: build
34+
runs-on: ubuntu-latest
35+
environment: pypi
36+
permissions:
37+
id-token: write # required for trusted publishing (OIDC)
38+
steps:
39+
- uses: actions/download-artifact@v4
40+
with:
41+
name: dist
42+
path: dist/
43+
- name: Publish to PyPI
44+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)