Skip to content

Commit 3d4500b

Browse files
Add PyPI publishing Github Actions workflow
1 parent 7ffe603 commit 3d4500b

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish to PyPI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v6
11+
with:
12+
persist-credentials: false
13+
- name: Set up Python
14+
uses: actions/setup-python@v6
15+
with:
16+
python-version: "3.x"
17+
- name: Install pypa/build
18+
run: >-
19+
python3 -m
20+
pip install
21+
build
22+
--user
23+
- name: Build a binary wheel and a source tarball
24+
run: python3 -m build
25+
- name: Store the distribution packages
26+
uses: actions/upload-artifact@v5
27+
with:
28+
name: python-package-distributions
29+
path: dist/
30+
31+
publish-to-pypi:
32+
name: >-
33+
Publish to PyPI
34+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
35+
needs:
36+
- build
37+
runs-on: ubuntu-latest
38+
environment:
39+
name: pypi
40+
url: https://pypi.org/p/dqlite-wire
41+
permissions:
42+
id-token: write
43+
steps:
44+
- name: Download all the dists
45+
uses: actions/download-artifact@v6
46+
with:
47+
name: python-package-distributions
48+
path: dist/
49+
- name: Publish to PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)