name: PyPI source deployer
on:
  push:
    tags:
      - 'v*'
jobs:
  # Deploy source distribution
  Source-dist:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.9
      - name: Create source distribution
        run: python setup.py sdist --formats=zip
      - name: Upload source package to PyPI
        env:
          TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
        run: |
          pip install twine
          twine upload dist/*
