Skip to content

Commit b50cf71

Browse files
add: Add pypi publishment workflow
1 parent 9691f1c commit b50cf71

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: '3.8'
20+
21+
- name: Install PDM
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install pdm twine
25+
26+
- name: Install dependencies
27+
run: |
28+
pdm install --prod
29+
30+
- name: Build the package
31+
run: |
32+
pdm build
33+
34+
- name: Publish to PyPI
35+
env:
36+
TWINE_USERNAME: "__token__"
37+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
38+
run: |
39+
twine upload --verbose dist/*

0 commit comments

Comments
 (0)