|
24 | 24 | include: |
25 | 25 | - { os: windows-latest, name: win_amd64 } |
26 | 26 | - { os: ubuntu-24.04, name: manylinux2014_x86_64 } |
27 | | - - { os: macos-13, name: macosx_x86_64 } |
28 | | - - { os: macos-14, name: macosx_arm64 } |
| 27 | + # Single universal2 wheel covers both Intel and Apple Silicon |
| 28 | + # in one artifact. The macos-13 (Intel-only) GitHub-hosted |
| 29 | + # runners have unreliable capacity and routinely queue |
| 30 | + # indefinitely, so we cross-build on macos-14 instead. |
| 31 | + - { os: macos-14, name: macosx_universal2 } |
29 | 32 | runs-on: ${{ matrix.os }} |
30 | 33 | steps: |
31 | 34 | - uses: actions/checkout@v4 |
@@ -56,14 +59,27 @@ jobs: |
56 | 59 | cmake --build build --config Release -j --target slothdb_shared |
57 | 60 | cp build/src/Release/slothdb.dll python/slothdb/ |
58 | 61 |
|
59 | | - - name: Build shared lib (macOS) |
| 62 | + - name: Build shared lib (macOS, universal2) |
60 | 63 | if: runner.os == 'macOS' |
61 | 64 | run: | |
62 | | - cmake -B build -DSLOTHDB_BUILD_SHARED=ON -DSLOTHDB_BUILD_SHELL=OFF -DSLOTHDB_BUILD_TESTS=OFF -DSLOTHDB_ASK_MODEL=OFF -DCMAKE_BUILD_TYPE=Release |
| 65 | + cmake -B build \ |
| 66 | + -DSLOTHDB_BUILD_SHARED=ON -DSLOTHDB_BUILD_SHELL=OFF \ |
| 67 | + -DSLOTHDB_BUILD_TESTS=OFF -DSLOTHDB_ASK_MODEL=OFF \ |
| 68 | + -DCMAKE_BUILD_TYPE=Release \ |
| 69 | + -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ |
| 70 | + -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 |
63 | 71 | cmake --build build -j$(sysctl -n hw.ncpu) --target slothdb_shared |
| 72 | + # Confirm the dylib has both slices. |
| 73 | + lipo -info build/src/libslothdb.dylib |
64 | 74 | cp build/src/libslothdb.dylib python/slothdb/ |
65 | 75 |
|
66 | 76 | - name: Build wheel |
| 77 | + shell: bash |
| 78 | + env: |
| 79 | + # Tag the macOS wheel as macosx_11_0_universal2 so pip serves |
| 80 | + # it to both Intel and Apple Silicon users from one file. |
| 81 | + _PYTHON_HOST_PLATFORM: ${{ runner.os == 'macOS' && 'macosx-11.0-universal2' || '' }} |
| 82 | + ARCHFLAGS: ${{ runner.os == 'macOS' && '-arch x86_64 -arch arm64' || '' }} |
67 | 83 | run: | |
68 | 84 | python -m pip install --upgrade pip build |
69 | 85 | python -m build --wheel python/ |
|
0 commit comments