diff --git a/.github/workflows/build-test-package-python.yml b/.github/workflows/build-test-package-python.yml index b0dc109..25eea25 100644 --- a/.github/workflows/build-test-package-python.yml +++ b/.github/workflows/build-test-package-python.yml @@ -19,7 +19,7 @@ on: description: 'Git tag or commit hash for ITKPythonPackage build scripts to use' required: false type: string - default: 'aa3b0767801ecc489f6219777ead2652f7ac4ccf' + default: 'cc3cbd2edd350d193536d78c5f8ee5ace1e6defd' itk-python-package-org: description: 'Github organization name for fetching ITKPythonPackage build scripts' required: false @@ -30,17 +30,24 @@ on: # example: InsightSoftwareConsortium/ITKMeshToPolyData@3ad8f08:InsightSoftwareConsortium/ITKBSplineGradient@0.3.0 required: false type: string + manylinux-platforms: + description: 'JSON-formatted array of "-" specializations' + required: false + type: string + default: '["_2_28-x64","2014-x64","_2_28-aarch64"]' secrets: pypi_password: required: false # Packages will not be uploaded to PyPI if not set jobs: - build-linux-python-packages: + + build-linux-py: runs-on: ubuntu-22.04 strategy: max-parallel: 2 matrix: python-version: ["37", "38", "39", "310", "311"] + manylinux-platform: ${{ fromJSON(inputs.manylinux-platforms) }} steps: - uses: actions/checkout@v3 @@ -76,12 +83,13 @@ jobs: CMAKE_OPTIONS="--cmake_options ${{ inputs.cmake-options }}" fi - for manylinux_version in "_2_28" "2014"; do - rm -rf ITKPythonPackage - export MANYLINUX_VERSION=${manylinux_version} - echo "Building for manylinux specialization ${MANYLINUX_VERSION}" - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} $CMAKE_OPTIONS - done + MANYLINUX_PLATFORM=${{ matrix.manylinux-platform }} + echo "Manylinux platform ${MANYLINUX_PLATFORM}" + rm -rf ITKPythonPackage + export MANYLINUX_VERSION=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 1)` + export TARGET_ARCH=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 2)` + echo "Building for manylinux specialization ${MANYLINUX_VERSION} and target architecture ${TARGET_ARCH}" + ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} $CMAKE_OPTIONS - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v3 @@ -191,7 +199,7 @@ jobs: publish-python-packages-to-pypi: needs: - - build-linux-python-packages + - build-linux-py - build-macos-python-packages - build-windows-python-packages runs-on: ubuntu-22.04 diff --git a/README.md b/README.md index b58548d..bfef3ca 100644 --- a/README.md +++ b/README.md @@ -282,6 +282,24 @@ to direct workflow execution. itk-module-deps: 'InsightSoftwareConsortium/ITKMeshToPolyData@3ad8f08:InsightSoftwareConsortium/ITKBSplineGradient@0.3.0' ``` +- `manylinux-platforms`: Array of [manylinux](https://github.com/pypa/manylinux) + specialization build targets for Linux Python module wheels. Manylinux "provides + a convenient way to distribute binary Python extensions as wheels on Linux"; + see the [manylinux README](https://github.com/pypa/manylinux#manylinux) for more details. + An array entry includes both the name of the manylinux specialization, which is + related to the toolset to be used, and the platform architecture to target. + All supported specialization and architecture pairs are enabled by default + and listed in the example below, but can be disabled by removing them from the + input array in the calling external module workflow. + The array follows [JavaScript Object Notation (JSON)](https://www.json.org/json-en.html) syntax + and GHA jobs will launch in the order provided. + The array is formatted as '["-","-"]'. + +```yaml + with: + manylinux-platforms: '["_2_28-x64","2014-x64","_2_28-aarch64"]' +``` + ## Contributing Community contributions to `ITKRemoteModuleBuildTestPackageAction` are welcome!