Skip to content

Commit b798835

Browse files
authored
Merge pull request #21 from LiadOz/liadoz/add-publish-job
Add release job on tag
2 parents 5bd076e + 613091c commit b798835

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Tests
22

33
on:
44
push:
@@ -7,8 +7,7 @@ on:
77
# manually triggered
88

99
jobs:
10-
build:
11-
10+
test:
1211
runs-on: ubuntu-latest
1312
strategy:
1413
matrix:
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish Python distribution to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-distribution:
9+
name: Build distribution
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.11"
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@v3
28+
with:
29+
name: python-package-distributions
30+
path: dist/
31+
32+
publish-to-pypi:
33+
name: Publish Python distribution to PyPI
34+
needs:
35+
- build-distribution
36+
runs-on: ubuntu-latest
37+
38+
permissions:
39+
id-token: write # IMPORTANT: mandatory for trusted publishing
40+
41+
steps:
42+
- name: Download all the dists
43+
uses: actions/download-artifact@v3
44+
with:
45+
name: python-package-distributions
46+
path: dist/
47+
- name: Publish distribution to PyPI
48+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)