Skip to content

Commit de10ecd

Browse files
committed
[CI] Publishing job
1 parent cad881c commit de10ecd

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-20.04
11+
if: startsWith(github.event.ref, 'refs/tags/')
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Set up Python 3.8
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: 3.8
20+
21+
- name: Check Tag
22+
id: check-release-tag
23+
run: |
24+
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+[.][0-9]+[.][0-9]+(rc[0-9]+|[.]dev[0-9]+)?$ ]]; then
25+
echo ::set-output name=release_tag::true
26+
fi
27+
28+
- name: Publish to PyPI
29+
if: steps.check-release-tag.outputs.release_tag == 'true'
30+
run: |
31+
pip install --upgrade pip
32+
pip install --upgrade setuptools wheel twine
33+
python setup.py sdist bdist_wheel
34+
export TWINE_USERNAME=__token__
35+
export TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
36+
twine upload dist/*

0 commit comments

Comments
 (0)