Skip to content

Commit 0d5c6d9

Browse files
committed
add PyPI publish workflow
1 parent 41de358 commit 0d5c6d9

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/workflow.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags: ["v*.*.*"] # tag like v0.0.1 to publish
6+
7+
permissions:
8+
contents: read
9+
id-token: write # 🟢 enables OIDC for PyPI
10+
11+
jobs:
12+
build-and-publish:
13+
environment: pypi
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.11"
23+
24+
- name: Build sdist & wheel
25+
run: |
26+
python -m pip install --upgrade build
27+
python -m build
28+
29+
- name: Publish to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
packages_dir: dist # default; just explicit
33+
skip_existing: true # don’t fail if tag was re-run

0 commit comments

Comments
 (0)