Skip to content

Commit d532827

Browse files
committed
github: add Python publishing workflow
1 parent 221fca0 commit d532827

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
release-build:
12+
name: Build distribution
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
persist-credentials: false
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.x"
22+
- name: Build release distributions
23+
run: |
24+
python -m pip install build
25+
python -m build
26+
- name: Upload distributions
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: release-dists
30+
path: dist/
31+
32+
pypi-publish:
33+
runs-on: ubuntu-latest
34+
needs:
35+
- release-build
36+
permissions:
37+
id-token: write
38+
environment:
39+
name: pypi
40+
url: https://pypi.org/p/shader-workshop
41+
42+
steps:
43+
- name: Retrieve release distributions
44+
uses: actions/download-artifact@v4
45+
with:
46+
name: release-dists
47+
path: dist/
48+
- name: Publish release distributions to PyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1
50+
with:
51+
packages-dir: dist/

0 commit comments

Comments
 (0)