name: Publish to https://test.pypi.org/

on:
  push:
    branches:
      - master
  workflow_dispatch:


jobs:
  test_pypi:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install build

      - name: Build wheel and sdist
        run: |
          python -m build --sdist --wheel --outdir dist/

      - name: Publish to https://test.pypi.org/
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          password: ${{ secrets.TEST_PYPI_TOKEN }}
          repository_url: https://test.pypi.org/legacy/

name: Publish to https://test.pypi.org/

on:
  push:
    branches:
      - master
  workflow_dispatch:


jobs:
  test_pypi:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install build

      - name: Build wheel and sdist
        run: |
          python -m build --sdist --wheel --outdir dist/

      - name: Publish to https://test.pypi.org/
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          password: ${{ secrets.TEST_PYPI_TOKEN }}
          repository_url: https://test.pypi.org/legacy/

Set in check fetch-depth=0 to download the tags
Set in check fetch-depth=0 to download the tags

Without the tags `setuptools-scm` always generates the version
`0.0.post1`.
