name: Deploy sdist

on:
  release:
    types:
      - published

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout source
        uses: actions/checkout@v2

      - name: Create sdist
        shell: bash -l {0}
        run: python setup.py sdist

      - name: Publish package to PyPI
        if: github.event.action == 'published'
        uses: pypa/gh-action-pypi-publish@v1.4.1
        with:
          user: __token__
          password: ${{ secrets.pypi_password }}
