Skip to content

Commit 83beb30

Browse files
authored
ci-cd: add workflow to publish to pypi (#6)
Before there was no workflow to publish from main and develop branches to pypi registry. After this commit a new workflow is present. Signed-off by: Tomás NAVARRETE 🧅 also
1 parent 55540bc commit 83beb30

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
# Inspired from:
3+
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
4+
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
5+
6+
on:
7+
push:
8+
branches: [main, develop]
9+
tags: '*'
10+
jobs:
11+
build-n-publish:
12+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
13+
runs-on: ubuntu-latest
14+
permissions:
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@v5
18+
- name: Set up Python 3.12
19+
uses: actions/setup-python@v6
20+
with:
21+
python-version: "3.12"
22+
- name: Install pypa/build
23+
run: >-
24+
python -m
25+
pip install
26+
build
27+
--user
28+
- name: Build a binary wheel and a source tarball
29+
run: >-
30+
python -m
31+
build
32+
--outdir dist/
33+
.
34+
- name: Publish distribution 📦 to Test PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1
36+
with:
37+
repository-url: https://test.pypi.org/legacy/
38+
skip-existing: true
39+
- name: Publish distribution 📦 to PyPI
40+
if: startsWith(github.ref, 'refs/tags')
41+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)