| 1 |
# This workflows will upload a Python Package using Twine when a release is created |
| 2 |
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries |
| 3 |
|
| 4 |
name: Upload Python Package |
| 5 |
|
| 6 |
on: |
| 7 |
push: |
| 8 |
# Sequence of patterns matched against refs/tags |
| 9 |
tags: |
| 10 |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 11 |
|
| 12 |
jobs: |
| 13 |
deploy: |
| 14 |
runs-on: ubuntu-latest |
| 15 |
|
| 16 |
steps: |
| 17 |
- uses: actions/checkout@v2 |
| 18 |
- name: Set up Python |
| 19 |
uses: actions/setup-python@v1 |
| 20 |
with: |
| 21 |
python-version: '3.x' |
| 22 |
- name: Install dependencies |
| 23 |
run: | |
| 24 |
# Need to install setuptools_scm[toml] to make it return the actual version. |
| 25 |
pip install "setuptools>=42" wheel twine "setuptools_scm[toml]>=3.4" |
| 26 |
- name: Build and publish |
| 27 |
env: |
| 28 |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
| 29 |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
| 30 |
run: | |
| 31 |
python setup.py sdist bdist_wheel |
| 32 |
twine upload dist/* |