Skip to content

Commit a445b4c

Browse files
committed
Release workflow: publish to PyPI on tag via trusted publishing (OIDC)
1 parent 0614ef8 commit a445b4c

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-python@v5
13+
with:
14+
python-version: "3.12"
15+
- run: python -m pip install build
16+
- run: python -m build
17+
- uses: actions/upload-artifact@v4
18+
with:
19+
name: dist
20+
path: dist/
21+
22+
publish:
23+
needs: build
24+
runs-on: ubuntu-latest
25+
environment: pypi
26+
permissions:
27+
id-token: write # OIDC trusted publishing — no tokens anywhere
28+
steps:
29+
- uses: actions/download-artifact@v4
30+
with:
31+
name: dist
32+
path: dist/
33+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)