|
| 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, windows-latest, macos-13, macos-latest] |
| 12 | + #os: [ubuntu-latest] |
| 13 | + # os: [windows-2019] #latest] |
| 14 | + # os: [macos-latest] |
| 15 | + # os: [macos-13] |
| 16 | + # os: [macos-15-intel] |
| 17 | + # os: [ubuntu-latest, windows-2022, ubuntu-24.04-arm, macos-15-intel, macos-latest] |
| 18 | + os: [windows-2022] |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Install bootstrap Python (macOS only) |
| 24 | + if: runner.os == 'macOS' |
| 25 | + uses: actions/setup-python@v4 |
| 26 | + with: |
| 27 | + python-version: '3.11' |
| 28 | + |
| 29 | + # Apply patch only on Windows |
| 30 | + - name: Apply header patch on Windows |
| 31 | + if: matrix.os == 'windows-2022' |
| 32 | + run: | |
| 33 | + # Patch MinGW-w64 header files currently causing troubles for eC compiler (C99 .namedmembers assignments in AVX files, and re-defnitions of function type typedef in winbase.h) |
| 34 | + #git apply --directory=mingw64 '${{ github.workspace }}\patches\mingw64-gcc-12.2.0-patches.patch' |
| 35 | + cd C:\ |
| 36 | + copy ${{ github.workspace }}\patches\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16intrin.h C:\mingw64\lib\gcc\x86_64-w64-mingw32\14.2.0\include\avx512fp16intrin.h |
| 37 | + copy ${{ github.workspace }}\patches\lib\gcc\x86_64-w64-mingw32\12.2.0\include\avx512fp16vlintrin.h C:\mingw64\lib\gcc\x86_64-w64-mingw32\14.2.0\include\avx512fp16vlintrin.h |
| 38 | + copy ${{ github.workspace }}\patches\x86_64-w64-mingw32\include\winbase.h C:\mingw64\x86_64-w64-mingw32\include\winbase.h |
| 39 | +
|
| 40 | + # Used to host cibuildwheel |
| 41 | + - uses: actions/setup-python@v5 |
| 42 | + with: |
| 43 | + python-version: '3.11' |
| 44 | + |
| 45 | + - name: Initialize submodules |
| 46 | + run: git submodule update --init --recursive |
| 47 | + |
| 48 | + - name: Install cibuildwheel |
| 49 | + run: python3 -m pip install cibuildwheel==2.23.3 |
| 50 | + |
| 51 | + - name: Build wheels |
| 52 | + run: python3 -m cibuildwheel --output-dir wheelhouse |
| 53 | + env: |
| 54 | + CIBW_ENABLE: "pypy" |
| 55 | + # Windows PyPy 3.8 build is currently failing due to https://github.com/python-cffi/cffi/issues/170 |
| 56 | + # 32-bit builds on Windows are not supported because the MinGW-w64 does not have multilib enabled |
| 57 | + CIBW_SKIP: "cp36-* *-win32 pp*-win*" |
| 58 | + # This ensures WIN_SHELL_COMMANDS does not get defined on Windows in crossplatform.mk, which breaks deep directory creations |
| 59 | + # since commands are executed in a UNIX-like shell expecting 'mkdir -p' |
| 60 | + CIBW_ENVIRONMENT: 'MSYSCON=y PIP_FIND_LINKS="https://pypi.org/simple/ecrt https://pypi.org/simple/ecdev"' |
| 61 | + CIBW_BUILD_VERBOSITY: 1 |
| 62 | + CIBW_REPAIR_WHEEL_COMMAND_LINUX: 'auditwheel repair -w {dest_dir} {wheel} --exclude libecrt.so' |
| 63 | + # CIBW_REPAIR_WHEEL_COMMAND_MACOS: 'delocate-wheel -w {dest_dir} -v {wheel}' |
| 64 | + CIBW_REPAIR_WHEEL_COMMAND_MACOS: > |
| 65 | + sh -c ' |
| 66 | + set -e |
| 67 | +
|
| 68 | + TMP_DIR=$(mktemp -d); |
| 69 | + unzip -q {wheel} -d "$TMP_DIR"; |
| 70 | +
|
| 71 | + #otool -L "$TMP_DIR"/libCartoSym/lib/libCartoSym.dylib; |
| 72 | + #otool -l "$TMP_DIR"/libCartoSym/lib/libCartoSym.dylib; |
| 73 | +
|
| 74 | + #otool -L "$TMP_DIR"/libCartoSym/bin/cs-canif; |
| 75 | + #otool -l "$TMP_DIR"/libCartoSym/bin/cs-canif; |
| 76 | +
|
| 77 | + rm -r "$TMP_DIR" |
| 78 | +
|
| 79 | + cp {wheel} {dest_dir} |
| 80 | + ' |
| 81 | +
|
| 82 | + # CIBW_SOME_OPTION: value |
| 83 | + # CIBW_BEFORE_BUILD: | |
| 84 | + # python3 -c "print('setuptools version:', setuptools.__version__)" |
| 85 | + |
| 86 | + - uses: actions/upload-artifact@v4 |
| 87 | + with: |
| 88 | + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
| 89 | + path: ./wheelhouse/*.whl |
0 commit comments