name: Upload to PyPI

on:
  release:
    types: [published]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python
      uses: actions/setup-python@v1
      with:
        python-version: "3.7"
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        python -m pip install setuptools wheel twine
    - name: Package project
      run: |
        python setup.py sdist bdist_wheel
    - name: Upload distributions
      env:
        TWINE_USERNAME: __token__
        TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
      run: |
        twine upload dist/*

Create GitHub workflow for uploading to PyPI
Create GitHub workflow for uploading to PyPI