name: Tags
on:
  push:
    tags:
      - "v*"
jobs:
  upload:
    name: Upload to PyPI
    runs-on: ubuntu-latest
    steps:
      - name: Checkout source code
        uses: actions/checkout@v3
      - name: Set up Python 3.11
        uses: actions/setup-python@v4
        with:
          python-version: "3.11"
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install build
      - name: Build distributions
        # The following command(s) must produce ready-to-upload artifacts in the "dist" folder
        run: python -m build
      - name: Upload distributions to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          user: __token__
          password: ${{ secrets.PYPI_API_TOKEN }}
