name: Deploy to PyPI

# Controls when the workflow will run
on:
  # Triggers the workflow on new releases
  release:
    types: [published]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "deploy"
  deploy:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      - name: PyPI Deployment
        uses: casperdcl/deploy-pypi@v2
        with:
          # PyPI username
          user: ${{ secrets.PYPI_USER }}
          # PyPI password or API token
          password: ${{ secrets.TEST_PYPI_PASS }}
          # `setup.py` command to run ("true" is a shortcut for "clean sdist -d <dist_dir> bdist_wheel -d <dist_dir>")
          build: clean sdist -d dist/
          # `pip` command to run ("true" is a shortcut for "wheel -w <dist_dir> --no-deps .")
          pip: true

name: Deploy to PyPI

# Controls when the workflow will run
on:
  # Triggers the workflow on tag push
  push:
    tags:
      - "v*"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "deploy"
  deploy:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      - name: PyPI Deployment
        uses: casperdcl/deploy-pypi@v2
        with:
          # PyPI username
          user: ${{ secrets.PYPI_USER }}
          # PyPI password or API token
          password: ${{ secrets.TEST_PYPI_PASS }}
          # `setup.py` command to run ("true" is a shortcut for "clean sdist -d <dist_dir> bdist_wheel -d <dist_dir>")
          build: clean sdist -d dist/
          # `pip` command to run ("true" is a shortcut for "wheel -w <dist_dir> --no-deps .")
          pip: true
          
      - name: Github Release
        uses: softprops/action-gh-release@v1
        with:
          files: dist/*

Add release creation to workflow
Add release creation to workflow