name: Python Packages

on: [push]

jobs:
  Linux:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1

    - name: Fetch build script
      run: |
        curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O
        chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh

    - name: Build Python packages
      run: |
        export ITK_PACKAGE_VERSION=v5.1rc03
        ./dockcross-manylinux-download-cache-and-build-module-wheels.sh

    - name: Upload wheel artifact
      uses: actions/upload-artifact@v1
      with:
        name: LinuxWheels
        path: dist

  MacOS:
    runs-on: macos-10.15

    steps:
    - uses: actions/checkout@v1

    - name: Fetch build script
      run: |
        curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O
        chmod u+x macpython-download-cache-and-build-module-wheels.sh

    - name: Build Python packages
      run: |
        export ITK_PACKAGE_VERSION=v5.1rc03
        ./macpython-download-cache-and-build-module-wheels.sh

    - name: Upload wheel artifact
      uses: actions/upload-artifact@v1
      with:
        name: MacOSWheels
        path: dist

  Windows:
    runs-on: windows-2019

    steps:
    - uses: actions/checkout@v1

    - name: Fetch build script
      run: |
        curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O

    - name: Build Python packages
      run: |
        call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
        set ITK_PACKAGE_VERSION=v5.1rc03
        set CC=cl.exe
        set CXX=cl.exe
        powershell.exe -file .\windows-download-cache-and-build-module-wheels.ps1
      shell: cmd

    - name: Upload wheel artifact
      uses: actions/upload-artifact@v1
      with:
        name: WindowsWheels
        path: dist

Add Python Packages GitHub Action
ENH: Add Python Packages GitHub Action
