Skip to content

Commit 28de972

Browse files
Add publish-to-pypi.yml
1 parent efe55b0 commit 28de972

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*' # Workflow start when you push tag in folovings format: v1.0.0
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v3
14+
15+
- name: Setup Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.6' # Python version
19+
20+
- name: Upgrade pip
21+
run: pip install --upgrade pip
22+
23+
- name: Install build dependencies
24+
run: pip install build
25+
26+
- name: Build the package
27+
run: python -m build --sdist --wheel
28+
29+
- name: Publish to PyPI via Twine
30+
env:
31+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
32+
run: |
33+
pip install twine
34+
twine upload dist/* -u __token__ -p $PYPI_API_TOKEN

0 commit comments

Comments
 (0)