Skip to content

Commit 83f60a0

Browse files
committed
Add docs build job to CI and PyPI publish workflow on release
- Add a docs job to test.yml: installs .[doc] extras, runs make -C docs html, and uploads the built HTML as a GitHub Actions artifact - Add publish.yml: triggers on GitHub release (published event), builds a source distribution and wheel with python -m build, then publishes to PyPI using pypa/gh-action-pypi-publish with OIDC trusted publishing (no API token secret required; configure the pypi environment in repository settings) Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ed46403 commit 83f60a0

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

.github/workflows/publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python 3.14
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.14"
19+
20+
- name: Install build tools
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install build
24+
25+
- name: Build source distribution and wheel
26+
run: python -m build
27+
28+
- name: Upload distribution artifacts
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: dist
32+
path: dist/
33+
34+
publish:
35+
needs: build
36+
runs-on: ubuntu-latest
37+
environment: pypi
38+
permissions:
39+
id-token: write
40+
41+
steps:
42+
- name: Download distribution artifacts
43+
uses: actions/download-artifact@v4
44+
with:
45+
name: dist
46+
path: dist/
47+
48+
- name: Publish to PyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,29 @@ jobs:
4242
with:
4343
name: coverage-report
4444
path: htmlcov/
45+
46+
docs:
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- name: Checkout code
51+
uses: actions/checkout@v4
52+
53+
- name: Set up Python 3.14
54+
uses: actions/setup-python@v4
55+
with:
56+
python-version: "3.14"
57+
58+
- name: Install doc dependencies
59+
run: |
60+
python -m pip install --upgrade pip
61+
pip install ".[doc]"
62+
63+
- name: Build documentation
64+
run: make -C docs html
65+
66+
- name: Upload documentation
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: documentation
70+
path: docs/build/html/

0 commit comments

Comments
 (0)