name: PyPI publishing

on:
  push:
  create:

jobs:
  pypi_publish:
    name: Publish to PyPI

    runs-on: ubuntu-latest

    strategy:
      fail-fast: true

    if: contains(github.ref, 'refs/tags/')

    steps:

        - name: Checkout repository
          uses: actions/checkout@v2

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

        - name: Install dependencies
          run: sh bin/cicd_install.sh

        #########################
        # Test PyPI

        - name: Configure Test Pypi
          run: poetry config repositories.testpypi https://test.pypi.org/legacy/

        - name: Publish to Test PyPI
          env: # Or as an environment variable
            TEST_PYPI_TOKEN: ${{ secrets.SuperSecret }}
          run: poetry publish --build -r testpypi -u __token__ -p $TEST_PYPI_TOKEN

        - name: Validate test build
          run: sh bin/cicd_validate_build.sh test $(poetry version -s)

        #########################
        # PyPI

        # - name: Publish to PyPI
        #   run: poetry publish
          
        # - name: Validate build
        #   run: sh in/cicd_validate_production_build.sh

name: PyPI publishing

on:
  push:
  create:

jobs:
  pypi_publish:
    name: Publish to PyPI

    runs-on: ubuntu-latest

    strategy:
      fail-fast: true

    if: contains(github.ref, 'refs/tags/')

    steps:

        - name: Checkout repository
          uses: actions/checkout@v2

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

        - name: Install dependencies
          run: sh bin/cicd_install.sh

        #########################
        # Test PyPI

        - name: Configure Test Pypi
          run: poetry config repositories.testpypi https://test.pypi.org/legacy/

        - name: Publish to Test PyPI
          env: # Or as an environment variable
            TEST_PYPI_TOKEN: ${{ secrets.SuperSecret }}
          run: poetry publish --build -r testpypi -u __token__ -p "$TEST_PYPI_TOKEN"

        - name: Validate test build
          run: sh bin/cicd_validate_build.sh test $(poetry version -s)

        #########################
        # PyPI

        # - name: Publish to PyPI
        #   run: poetry publish
          
        # - name: Validate build
        #   run: sh in/cicd_validate_production_build.sh

Update test PyPI publish command
Update test PyPI publish command
