name: PyPI pure Python wheel deployer
on:
  push:
    tags:
      - 'v*'
  workflow_dispatch:

jobs:
  # Deploy source distribution
  Source-dist:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: pypy-3.11
      - name: create pure Python wheel
        run: |
          pypy -m pip install "setuptools>69.0.0" wheel
          pypy setup.py bdist_wheel
      - name: Upload pure Python wheel to PyPI
        env:
          TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
        run: |
          pip install twine
          twine upload dist/*
