Skip to content

Commit 8f85b87

Browse files
authored
Add release workflow (#14)
1 parent 5a6f22c commit 8f85b87

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/release.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
env:
9+
DEFAULT_PYTHON: 3.9
10+
11+
jobs:
12+
release-pypi:
13+
name: Upload release to PyPI
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out code from Github
17+
uses: actions/[email protected]
18+
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
19+
id: python
20+
uses: actions/[email protected]
21+
with:
22+
python-version: ${{ env.DEFAULT_PYTHON }}
23+
- name: Install requirements
24+
run: |
25+
python -m pip install -U pip setuptools twine wheel
26+
- name: Build distributions
27+
run: |
28+
python setup.py sdist bdist_wheel
29+
- name: Upload to PyPI
30+
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
31+
env:
32+
TWINE_REPOSITORY: pypi
33+
TWINE_USERNAME: __token__
34+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
35+
run: |
36+
twine upload --verbose dist/*

0 commit comments

Comments
 (0)