Skip to content

Commit 83d15e4

Browse files
committed
SIANXKE-151: Added workflow to publish the package
1 parent 40dd2de commit 83d15e4

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish package
2+
on:
3+
release:
4+
types: [created]
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: '3.10'
17+
architecture: 'x64'
18+
19+
- name: Install dependencies and package
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install -r requirements.txt
23+
24+
- name: Build source and binary distribution package
25+
run: |
26+
python setup.py sdist bdist_wheel
27+
env:
28+
PACKAGE_VERSION: ${{ github.ref }}
29+
30+
- name: Check distribution package
31+
run: |
32+
twine check dist/*
33+
34+
- name: Publish distribution package
35+
run: |
36+
twine upload dist/*
37+
env:
38+
TWINE_REPOSITORY: ${{ secrets.PYPI_REPOSITORY }}
39+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
40+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
41+
TWINE_NON_INTERACTIVE: yes

0 commit comments

Comments
 (0)