name: Make Release

on:
  release:
    types:
      - published

jobs:
  packages:
    name: Release Packages
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 150

    - name: Get tags
      run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

    - name: Set up Python
      uses: actions/setup-python@v2
      with:
        python-version: 3.8

    - name: Install build tools
      run: |
        python -m pip install --upgrade pip
        python -m pip install --upgrade setuptools setuptools_scm wheel

    - name: Build packages
      run: python setup.py sdist bdist_wheel

    - name: Publish Package
      uses: pypa/gh-action-pypi-publish@master
      with:
        user: __token__
        password: ${{ secrets.pypi_token }}

Add workflow for publishing to PyPI
CI: Add workflow for publishing to PyPI

This works only when a new release is published.
