name: Python package


on: [push]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.6, 3.7, 3.8, 3.9]

    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 --upgrade pip
          pip install tox tox-gh-actions

      - name: Test with tox
        run: tox

name: Python package


on: [push]

jobs:

  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.6, 3.7, 3.8, 3.9]

    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 --upgrade pip
          pip install tox tox-gh-actions

      - name: Test with tox
        run: tox

      - name: Build with bdist wheel
        run: |
          pip install cython numpy setuptools wheel
          python setup.py bdist_wheel

      - name: Archive production artifacts
        uses: actions/upload-artifact@v2
        with:
          name: dist
          path: |
            dist

  build-sdist:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python 3.9
        uses: actions/setup-python@v2
        with:
          python-version: 3.9

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install cython numpy setuptools wheel
          python setup.py sdist

      - name: Archive production artifacts
        uses: actions/upload-artifact@v2
        with:
          name: dist
          path: |
            dist

  release:
    needs: ["build-sdist", "build"]
    runs-on: ubuntu-latest
    steps:
      - name: Download all workflow run artifacts
        uses: actions/download-artifact@v2
      - run: ls dist

Build wheels and sdist in CI
ci: Build wheels and sdist in CI
