Skip to content

Commit 4a6b20b

Browse files
authored
Add GitHub Actions workflow for PyPI publishing
1 parent baa5d1e commit 4a6b20b

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/publish.yml

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

0 commit comments

Comments
 (0)