|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build_wheels: |
| 7 | + name: Build wheels on ${{ matrix.os }} |
| 8 | + runs-on: ${{ matrix.os }} |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + os: [ubuntu-latest, ubuntu-24.04-arm] |
| 12 | + |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v5 |
| 15 | + |
| 16 | + - uses: actions/setup-python@v5 |
| 17 | + with: |
| 18 | + python-version: "3.12" |
| 19 | + |
| 20 | + - name: Install cibuildwheel |
| 21 | + run: python -m pip install cibuildwheel==3.1.4 |
| 22 | + |
| 23 | + - name: Build wheels (compile-only, CUDA 12.9) |
| 24 | + env: |
| 25 | + # Which Python/ABI wheels to build |
| 26 | + CIBW_BUILD: "cp3{9,10,11,12}-manylinux_{x86_64,aarch64}" |
| 27 | + CIBW_SKIP: "pp* *-musllinux* *-win* *-macosx*" |
| 28 | + |
| 29 | + # Point cibuildwheel to custom manylinux images with CUDA 12.9 |
| 30 | + CIBW_MANYLINUX_X86_64_IMAGE: "ghcr.io/OWNER/REPO:manylinux_2_28_x86_64_cuda12.9" |
| 31 | + CIBW_MANYLINUX_AARCH64_IMAGE: "ghcr.io/OWNER/REPO:manylinux_2_28_aarch64_cuda12.9" |
| 32 | + |
| 33 | + # Make CUDA visible in the container |
| 34 | + CIBW_ENVIRONMENT: > |
| 35 | + CUDA_HOME=/usr/local/cuda |
| 36 | + LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH |
| 37 | + PATH=/usr/local/cuda/bin:$PATH |
| 38 | +
|
| 39 | + # Ensure build tooling for nanobind extension is present |
| 40 | + CIBW_BEFORE_BUILD: > |
| 41 | + python -m pip install -U pip |
| 42 | + scikit-build-core cmake ninja nanobind |
| 43 | +
|
| 44 | + # Compile-only: don’t run runtime tests (needs GPU) |
| 45 | + CIBW_TEST_SKIP: "*" |
| 46 | + CIBW_TEST_COMMAND: "" |
| 47 | + |
| 48 | + # Let auditwheel check manylinux tags and bundle CUDA libs |
| 49 | + # (set to "" to go faster if you only want compile proof) |
| 50 | + CIBW_REPAIR_WHEEL_COMMAND: "auditwheel repair -w {dest_dir} {wheel}" |
| 51 | + |
| 52 | + # Show compiler/linker commands |
| 53 | + CIBW_BUILD_VERBOSITY: "1" |
| 54 | + run: python -m cibuildwheel --output-dir wheelhouse |
| 55 | + |
| 56 | + - uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
| 59 | + path: ./wheelhouse/*.whl |
0 commit comments