Skip to content

Commit 1d18858

Browse files
committed
add publishing workflow
1 parent c0c4be8 commit 1d18858

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/publish.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
name: Build distributions
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.12"
24+
cache: "pip"
25+
26+
- name: Install build tooling
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install build
30+
31+
- name: Build sdist and wheel
32+
run: python -m build
33+
34+
- name: Upload dist artifacts
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: dist
38+
path: dist/
39+
40+
publish:
41+
name: Publish to PyPI
42+
needs: build
43+
runs-on: ubuntu-latest
44+
permissions:
45+
id-token: write
46+
steps:
47+
- name: Download dist artifacts
48+
uses: actions/download-artifact@v4
49+
with:
50+
name: dist
51+
path: dist/
52+
53+
- name: Publish
54+
uses: pypa/gh-action-pypi-publish@release/v1
55+
with:
56+
packages-dir: dist/

0 commit comments

Comments
 (0)