Skip to content

Commit 307de8b

Browse files
authored
Merge pull request #592 from joselsegura/add_release_job
[CCXDEV-15492] Add CI job to publish into PyPI
2 parents 23f52b2 + 47496c5 commit 307de8b

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/pypi-release.yml

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 and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Build distribution
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
persist-credentials: false
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 pip install build --user
21+
- name: Build a binary wheel and a source tarball
22+
run: python3 -m build
23+
- name: Store the distribution packages
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: python-package-distributions
27+
path: dist/
28+
29+
publish-to-pypi:
30+
name: Publish Python distribution to PyPI
31+
if: startsWith(github.ref, 'refs/tags/')
32+
needs:
33+
- build
34+
runs-on: ubuntu-latest
35+
environment:
36+
name: pypi
37+
url: https://pypi.org/p/ccx-messaging
38+
permissions:
39+
id-token: write
40+
41+
steps:
42+
- name: Download all the dists
43+
uses: actions/download-artifact@v4
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)