Skip to content

Commit eed5815

Browse files
committed
Github: Adding workflow to publish on Pypi
1 parent 44be0fd commit eed5815

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/workflow.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Python Package
2+
3+
# To trigger the workflow, you need to tag the library with a version number like this:
4+
#git tag v1.0.0
5+
#git push origin v1.0.0
6+
7+
on:
8+
push:
9+
tags:
10+
- 'v*.*.*' # Triggers on version tags like v1.0.0, v2.1.3, etc.
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.x' # Choose your Python version (e.g., '3.9')
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install build
29+
30+
- name: Build package
31+
run: python -m build
32+
33+
- name: Publish to PyPI
34+
env:
35+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
36+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
37+
run: |
38+
pip install twine
39+
twine upload dist/*

0 commit comments

Comments
 (0)