Skip to content

Commit 9d08f9c

Browse files
authored
Add GitHub Actions workflow for PyPI publishing
1 parent f3fe520 commit 9d08f9c

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
15+
environment: release
16+
permissions:
17+
id-token: write
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v6
24+
with:
25+
python-version: '3.13'
26+
cache: 'pip'
27+
28+
- name: Install dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install hatch
32+
33+
- name: Build package
34+
run: hatch build
35+
36+
- name: Run tests with hatch
37+
run: |
38+
hatch run test:run
39+
40+
- name: Publish package distributions to PyPI
41+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)