Skip to content

Commit 9261cc6

Browse files
committed
Automate publishing to PyPI
1 parent 25c008b commit 9261cc6

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.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+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-24.04
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.12"
17+
- name: Install
18+
run: |
19+
pip install pytest
20+
pip install -e .
21+
- name: Test
22+
run: |
23+
python -m pytest
24+
deploy:
25+
runs-on: ubuntu-24.04
26+
needs: [test]
27+
permissions:
28+
id-token: write
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: '3.12'
35+
cache: pip
36+
cache-dependency-path: '**/pyproject.toml'
37+
- name: Install dependencies
38+
run: |
39+
pip install setuptools wheel build
40+
- name: Build
41+
run: |
42+
python -m build
43+
- name: Publish
44+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)