This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github action to be able to release on published tag
- Loading branch information
1 parent
187bac7
commit ae3c5cc
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
DEFAULT_PYTHON: 3.9 | ||
|
||
jobs: | ||
release-pypi: | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code from Github | ||
uses: actions/checkout@v3.0.0 | ||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/setup-python@v3.0.0 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
- name: Install requirements | ||
run: | | ||
python -m pip install -U pip twine wheel | ||
python -m pip install -U "setuptools>=56.0.0" | ||
- name: Build distributions | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
- name: Upload to PyPI | ||
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags') | ||
env: | ||
TWINE_REPOSITORY: pypi | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
twine upload --verbose dist/* |