name: Publish to PyPI 📦
on:
  workflow_dispatch:
jobs:
  publish:
    name: Build and publish
    runs-on: ubuntu-latest
    environment: release
    permissions:
      id-token: write
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
      - name: Set up Python 3.13
        uses: actions/setup-python@v3
        with:
          python-version: "3.13"
      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install build
      - name: Build sdist
        run: python -m build --sdist
      - name: Publish to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1