name: "Publish to PyPI"

on:
  push:
    branches: [ develop ]
    tags: [ '*' ]
  pull_request:
    # The branches below must be a subset of the branches above
    branches: [ develop ]
  schedule:
    - cron: '30 22 15 * *'

jobs:
  build-and-publish:
    name: Build and publish Python distributions to PyPI
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

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

      - name: Install pypa/build
        run: |
          pip install build
          pip list

      - name: Build a binary wheel and a source tarball
        run: python -m build

      - name: Publish distribution to PyPI
        if: startsWith(github.ref, 'refs/tags')
        uses: pypa/gh-action-pypi-publish@master
        with:
          password: ${{ secrets.PYPI_API_TOKEN }}

      - uses: actions/upload-artifact@v2
        with:
          name: pypi-packages
          path: dist/

name: "Publish to PyPI"

on:
  push:
    branches: [ develop ]
    tags: [ '*' ]
  pull_request:
    # The branches below must be a subset of the branches above
    branches: [ develop ]
  schedule:
    - cron: '30 22 15 * *'

jobs:
  build-and-publish:
    name: Build and publish Python distributions to PyPI
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

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

      - name: Install pypa/build
        run: |
          pip install build
          pip list

      - name: Build a binary wheel and a source tarball
        run: python -m build

      - name: Publish distribution to PyPI
        if: startsWith(github.ref, 'refs/tags')
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          password: ${{ secrets.PYPI_API_TOKEN }}

      - uses: actions/upload-artifact@v2
        with:
          name: pypi-packages
          path: dist/

Swap pypa/gh-action-pypi-publish@master to release/v1 as recommended
Swap pypa/gh-action-pypi-publish@master to release/v1 as recommended
