wheels #67
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: wheels | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build_wheels: | |
name: Wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-24.04 | |
build_tool_args: -j4 | |
cibw_image: quay.io/pypa/manylinux_2_28_x86_64 | |
cibw_archs: x86_64 | |
cibw_build: cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 | |
preset: ci-pip-cuda | |
sub_packages: '["nvcc", "cudart"]' | |
- os: windows-2022 | |
build_tool_args: /p:CL_MPCount=4 | |
cibw_archs: AMD64 | |
cibw_build: cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 | |
preset: ci-pip-cuda | |
sub_packages: '["nvcc", "cudart", "visual_studio_integration"]' | |
- os: macos-13 | |
build_tool_args: -j4 | |
cibw_archs: x86_64 universal2 | |
cibw_build: cp310-macosx_x86_64 cp311-macosx_x86_64 cp312-macosx_x86_64 cp310_macosx_universal2 cp311_macosx_universal2 cp312_macosx_universal2 | |
macosx_deployment_target: "13.0" | |
preset: pip | |
- os: macos-14 | |
build_tool_args: -j4 | |
cibw_archs: arm64 universal2 | |
cibw_build: cp310-macosx_arm64 cp311-macosx_arm64 cp312-macosx_arm64 cp310_macosx_universal2 cp311_macosx_universal2 cp312_macosx_universal2 | |
macosx_deployment_target: "14.0" | |
preset: pip | |
max-parallel: 4 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Jimver/[email protected] | |
if: ${{ !startsWith(matrix.os, 'macos') }} | |
with: | |
cuda: '12.5.1' | |
method: 'network' | |
sub-packages: ${{ matrix.sub_packages }} | |
non-cuda-sub-packages: '[]' | |
- run: ls ${{ steps.cuda-toolkit.outputs.CUDA_PATH }} | |
- run: ls ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}/bin | |
- name: Setup vcpkg | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgDirectory: ${{ github.workspace }}/vcpkg | |
vcpkgGitCommitId: 055721089e8037d4d617250814d11f881e557549 | |
- uses: pypa/[email protected] | |
env: | |
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }} | |
CIBW_ENVIRONMENT_LINUX: VCPKG_ROOT=/host/${{ github.workspace }}/vcpkg CUDA_PATH=/host/${{ steps.cuda-toolkit.outputs.CUDA_PATH }} CMAKE_CUDA_COMPILER=/host/${{ steps.cuda-toolkit.outputs.CUDA_PATH }}/bin/nvcc | |
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.cibw_image }} | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
CIBW_BUILD: ${{ matrix.cibw_build }} | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_CONFIG_SETTINGS: cmake.args="--preset=${{ matrix.preset }}" build.tool-args=${{ matrix.build_tool_args }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ matrix.os }} | |
path: wheelhouse/*.whl | |
upload_all: | |
name: Upload release | |
needs: [build_wheels] | |
runs-on: ubuntu-latest | |
# if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch') | |
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this) | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
environment: pypi | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-* | |
path: dist | |
merge-multiple: true | |
- uses: pypa/gh-action-pypi-publish@release/v1 |