diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index c7cfbc8..654b2b2 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -2,179 +2,11 @@ name: Build, test, package on: [push,pull_request] -env: - itk-git-tag: "171fb2ba33a87041f99328a2f26612ff33aa9cc8" - itk-wheel-tag: "v5.3rc04.post3" # Same ITK C++ reference commit, different tag name - jobs: - build-test-cxx: - runs-on: ${{ matrix.os }} - strategy: - max-parallel: 3 - matrix: - os: [ubuntu-20.04, windows-2019, macos-11] - include: - - os: ubuntu-20.04 - cmake-build-type: "MinSizeRel" - - os: windows-2019 - cmake-build-type: "Release" - - os: macos-11 - cmake-build-type: "MinSizeRel" - - steps: - - uses: actions/checkout@v1 - - - name: Build, test cxx - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction@a6f55fb20f1ff6456218c458cfdbadea11c9cc33 - with: - cmake-build-type: ${{ matrix.cmake-build-type }} - itk-git-tag: ${{ env.itk-git-tag }} - - build-linux-python-packages: - runs-on: ubuntu-20.04 - strategy: - max-parallel: 2 - matrix: - python-version: [37, 38, 39, 310] - - steps: - - uses: actions/checkout@v2 - - - name: 'Free up disk space' - run: | - # Workaround for https://github.com/actions/virtual-environments/issues/709 - df -h - sudo apt-get clean - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - df -h - - - 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 📦 package' - run: | - export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} - for tarball in "-manylinux_2_28" "-manylinux2014"; do - rm -rf ITKPythonPackage - export TARBALL_SPECIALIZATION=${tarball} - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} - done - - - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 - with: - name: LinuxWheel${{ matrix.python-version }} - path: dist - - build-macos-python-packages: - runs-on: macos-11 - strategy: - max-parallel: 2 - - steps: - - uses: actions/checkout@v2 - - - name: 'Specific XCode version' - run: | - ls "/Applications" - sudo xcode-select -s "/Applications/Xcode_13.2.1.app" - - - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.18.3 - - - 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 📦 package' - run: | - export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} - export MACOSX_DEPLOYMENT_TARGET=10.11 - ./macpython-download-cache-and-build-module-wheels.sh - - - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 - with: - name: MacOSWheels - path: dist - - build-windows-python-packages: - runs-on: windows-2019 - strategy: - max-parallel: 2 - matrix: - python-version-minor: [7, 8, 9, 10] - - steps: - - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.18.3 - - - uses: actions/checkout@v2 - with: - path: "im" - - - name: 'Install Python' - run: | - $pythonArch = "64" - $pythonVersion = "3.${{ matrix.python-version-minor }}" - iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) - - - name: 'Fetch build dependencies' - shell: bash - run: | - mv im ../../ - cd ../../ - curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ env.itk-wheel-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" - 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r - curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" - 7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r - curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip" - 7z x grep-win.zip -o/c/P/grep -aoa -r - - - name: 'Build 🐍 Python 📦 package' - shell: cmd - run: | - cd ../../im - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set PATH=C:\P\grep;%PATH% - set CC=cl.exe - set CXX=cl.exe - C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" --no-cleanup - - - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 - with: - name: WindowsWheel3.${{ matrix.python-version-minor }} - path: ../../im/dist - - publish-python-packages-to-pypi: - needs: - - build-linux-python-packages - - build-macos-python-packages - - build-windows-python-packages - runs-on: ubuntu-18.04 - - steps: - - name: Download Python Packages - uses: actions/download-artifact@v2 - - - name: Prepare packages for upload - run: | - ls -R - for d in */; do - mv ${d}/*.whl . - done - mkdir dist - mv *.whl dist/ - ls dist + cxx-build-workflow: + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.3rc04.post3 - - name: Publish 🐍 Python 📦 package 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 }} + python-build-workflow: + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.3rc04.post3 + secrets: + pypi_password: ${{ secrets.pypi_password }}