name: Publish Python 🐍 package

on:
  release:
    types: [published]

jobs:
  build-n-publish:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: "3.7"

    - name: Build distribution
      run: |
        pip install setuptools_scm wheel
        python3 setup.py sdist bdist_wheel

    - name: Publish distribution 📦 to PyPI
      uses: pypa/gh-action-pypi-publish@master
      with:
        user: __token__
        password: ${{ secrets.pypi_password }}

    - name: Publish distribution 📦 to Test PyPI
      uses: pypa/gh-action-pypi-publish@master
      with:
        user: __token__
        password: ${{ secrets.test_pypi_password }}
        repository_url: https://test.pypi.org/legacy/
name: Publish Python 🐍 package

on: [push]

jobs:
  build-n-publish:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: "3.7"

    - name: Build distribution
      run: |
        pip install setuptools_scm wheel
        python3 setup.py sdist bdist_wheel

    - name: Publish distribution 📦 to PyPI
      if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
      uses: pypa/gh-action-pypi-publish@master
      with:
        user: __token__
        password: ${{ secrets.pypi_password }}

    - name: Publish distribution 📦 to Test PyPI
      if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
      uses: pypa/gh-action-pypi-publish@master
      with:
        user: __token__
        password: ${{ secrets.test_pypi_password }}
        repository_url: https://test.pypi.org/legacy/
Update event name in GitHub Action
Update event name in GitHub Action
