name: Packaging

on:
  push:
  release:
    types: [published]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [macos-latest, ubuntu-latest]
        python-version: [pypy2, pypy3, 3.7, 3.8]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: python -m pip install pep517
    - name: Evade 'pypa/pep517#74'
      run: python -m pip install -U setuptools setuptools-scm pip wheel
      if: startsWith(matrix.python-version, 'pypy')
    - name: Create packages
      run: python -m pep517.build .
    - uses: actions/upload-artifact@master
      with:
        name: dist-${{ matrix.os }}-${{ matrix.python-version }}
        path: dist
    - name: Publish package
      if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && matrix.python-version == 'pypy3' && runner.os == 'Linux'
      uses: pypa/gh-action-pypi-publish@master
      with:
        user: __token__
        password: ${{ secrets.pypi_password }}

name: Packaging

on:
  push:
  release:
    types: [published]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [macos-latest, ubuntu-latest]
        python-version: [pypy3, 3.7, 3.8]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: python -m pip install pep517
    - name: Evade 'pypa/pep517#74'
      run: python -m pip install -U setuptools setuptools-scm pip wheel
      if: startsWith(matrix.python-version, 'pypy')
    - name: Create packages
      run: python -m pep517.build .
    - uses: actions/upload-artifact@master
      with:
        name: dist-${{ matrix.os }}-${{ matrix.python-version }}
        path: dist
    - name: Publish package
      if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && matrix.python-version == 'pypy3' && runner.os == 'Linux'
      uses: pypa/gh-action-pypi-publish@master
      with:
        user: __token__
        password: ${{ secrets.pypi_password }}

Drop building the package on Py2 in CI.
Drop building the package on Py2 in CI.
