| 1 |
name: Build and Publish |
| 2 |
|
| 3 |
|
| 4 |
on: |
| 5 |
release: |
| 6 |
types: [created] |
| 7 |
push: |
| 8 |
branches: master |
| 9 |
pull_request: |
| 10 |
|
| 11 |
jobs: |
| 12 |
deploy: |
| 13 |
name: Build and Publish |
| 14 |
runs-on: ubuntu-latest |
| 15 |
steps: |
| 16 |
- uses: actions/checkout@v2 |
| 17 |
- name: Set up Python |
| 18 |
uses: actions/setup-python@v2 |
| 19 |
with: |
| 20 |
python-version: 3.7 |
| 21 |
- name: Install dependencies |
| 22 |
run: | |
| 23 |
python -m pip install --upgrade pip |
| 24 |
pip install setuptools wheel twine |
| 25 |
- name: Build |
| 26 |
run: | |
| 27 |
python setup.py sdist bdist_wheel |
| 28 |
- name: Publish |
| 29 |
if: ${{ github.event_name == 'release' }} |
| 30 |
env: |
| 31 |
TWINE_USERNAME: __token__ |
| 32 |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
| 33 |
run: | |
| 34 |
twine upload dist/* |