Skip to content

Commit b89fa6b

Browse files
committed
Add GitHub Action for PyPI releases
1 parent 7c957ad commit b89fa6b

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/pypi-release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "PyPI releases"
2+
3+
on: release
4+
5+
jobs:
6+
build_sdist:
7+
name: Build Python source distribution
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Build sdist
13+
run: pipx run build --sdist
14+
15+
- uses: actions/upload-artifact@v4
16+
with:
17+
path: dist/*.tar.gz
18+
19+
pypi-publish:
20+
name: Upload release to PyPI
21+
if: github.event_name == 'release' && github.event.action == 'published'
22+
needs:
23+
- build_sdist
24+
runs-on: ubuntu-latest
25+
environment:
26+
name: pypi
27+
url: https://pypi.org/p/django-tabular-export
28+
permissions:
29+
id-token: write
30+
steps:
31+
- uses: actions/download-artifact@v4
32+
with:
33+
name: artifact
34+
path: dist
35+
- name: Publish package distributions to PyPI
36+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)