|
| 1 | +name: repair-wheels |
| 2 | + |
| 3 | +# Repairs wheels for all platforms (Windows, macOS, Linux) |
| 4 | +# - Windows: delvewheel (bundles DLLs) |
| 5 | +# - macOS: delocate (bundles dylibs) |
| 6 | +# - Linux: auditwheel (bundles SOs) |
| 7 | + |
| 8 | +on: |
| 9 | + workflow_call: |
| 10 | + |
| 11 | +jobs: |
| 12 | + repair-wheels: |
| 13 | + name: Repair ${{ matrix.platform }} wheels |
| 14 | + runs-on: ${{ matrix.runner }} |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + platform: |
| 19 | + - Windows |
| 20 | + - macOS ARM |
| 21 | + - macOS Intel |
| 22 | + - Linux x86_64 |
| 23 | + - Linux ARM64 |
| 24 | + - Linux ARMv7 |
| 25 | + include: |
| 26 | + - platform: Windows |
| 27 | + runner: windows-latest |
| 28 | + tool: delvewheel |
| 29 | + - platform: macOS ARM |
| 30 | + runner: macos-latest |
| 31 | + tool: delocate |
| 32 | + - platform: macOS Intel |
| 33 | + runner: macos-15-intel |
| 34 | + tool: delocate |
| 35 | + - platform: Linux x86_64 |
| 36 | + runner: ubuntu-latest |
| 37 | + tool: auditwheel |
| 38 | + manylinux_platform: manylinux_2_34_x86_64 |
| 39 | + - platform: Linux ARM64 |
| 40 | + runner: ubuntu-latest |
| 41 | + tool: auditwheel |
| 42 | + manylinux_platform: manylinux_2_34_aarch64 |
| 43 | + setup_qemu: true |
| 44 | + qemu_platform: arm64 |
| 45 | + - platform: Linux ARMv7 |
| 46 | + runner: ubuntu-latest |
| 47 | + tool: auditwheel |
| 48 | + manylinux_platform: manylinux_2_34_armv7l |
| 49 | + setup_qemu: true |
| 50 | + qemu_platform: arm/v7 |
| 51 | + |
| 52 | + steps: |
| 53 | + - name: Checkout repository |
| 54 | + uses: actions/checkout@v4 |
| 55 | + |
| 56 | + - name: Download wheel artifacts |
| 57 | + uses: actions/download-artifact@v4 |
| 58 | + with: |
| 59 | + pattern: wheels-download-directory-* |
| 60 | + path: ./downloaded_wheels |
| 61 | + merge-multiple: true |
| 62 | + |
| 63 | + - name: Setup Python |
| 64 | + uses: actions/setup-python@v5 |
| 65 | + with: |
| 66 | + python-version: '3.11' |
| 67 | + |
| 68 | + - name: Set up QEMU |
| 69 | + if: matrix.setup_qemu |
| 70 | + uses: docker/setup-qemu-action@v3 |
| 71 | + with: |
| 72 | + platforms: ${{ matrix.qemu_platform }} |
| 73 | + |
| 74 | + - name: Install repair tool - Windows |
| 75 | + if: matrix.tool == 'delvewheel' |
| 76 | + run: python -m pip install delvewheel |
| 77 | + |
| 78 | + - name: Install repair tool - macOS |
| 79 | + if: matrix.tool == 'delocate' |
| 80 | + run: python -m pip install delocate |
| 81 | + |
| 82 | + - name: Install OS dependencies - macOS |
| 83 | + if: matrix.tool == 'delocate' |
| 84 | + run: bash os_dependencies/macos.sh |
| 85 | + |
| 86 | + - name: Install dependencies and repair - Windows/macOS |
| 87 | + if: matrix.tool != 'auditwheel' |
| 88 | + run: | |
| 89 | + python -m pip install -r build_requirements.txt |
| 90 | + python repair_wheels.py |
| 91 | +
|
| 92 | + - name: Repair Linux wheels in manylinux container |
| 93 | + if: matrix.tool == 'auditwheel' |
| 94 | + run: | |
| 95 | + docker run --rm \ |
| 96 | + -v $(pwd):/work \ |
| 97 | + -w /work \ |
| 98 | + quay.io/pypa/${{ matrix.manylinux_platform }} \ |
| 99 | + bash -c " |
| 100 | + # Install OS dependencies |
| 101 | + bash os_dependencies/manylinux.sh |
| 102 | +
|
| 103 | + # Install pip if not available |
| 104 | + python3 -m ensurepip --default-pip || curl -sS https://bootstrap.pypa.io/get-pip.py | python3 |
| 105 | + python3 -m pip install --upgrade pip |
| 106 | +
|
| 107 | + # Install Python build requirements (ignore system packages to avoid conflicts) |
| 108 | + python3 -m pip install --ignore-installed -r build_requirements.txt |
| 109 | +
|
| 110 | + # Repair wheels |
| 111 | + python3 repair_wheels.py |
| 112 | + " |
| 113 | +
|
| 114 | + - name: Re-upload artifacts with repaired wheels |
| 115 | + uses: actions/upload-artifact@v4 |
| 116 | + with: |
| 117 | + name: wheels-repaired-${{ matrix.platform }} |
| 118 | + path: ./downloaded_wheels |
| 119 | + overwrite: true |
| 120 | + retention-days: 1 |
0 commit comments