Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit 0441486

Browse files
Add github action to be able to release on published tag
1 parent a6fe422 commit 0441486

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- published
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 twine wheel
26+
python -m pip install -U "setuptools>=56.0.0"
27+
- name: Build distributions
28+
run: |
29+
python setup.py sdist bdist_wheel
30+
- name: Upload to PyPI
31+
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
32+
env:
33+
TWINE_REPOSITORY: pypi
34+
TWINE_USERNAME: __token__
35+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
36+
run: |
37+
twine upload --verbose dist/*

0 commit comments

Comments
 (0)