From d1d0fbbbde479584e2e096b1d43376fd11088e9d Mon Sep 17 00:00:00 2001 From: Naveen M K Date: Fri, 13 Sep 2024 13:07:13 +0530 Subject: [PATCH] CI: fix windows wheels build also some general improvements --- .github/workflows/build.yml | 71 +++++++++++++------------------------ .gitignore | 1 + 2 files changed, 25 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d94769c3..d53b9f1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,63 +16,49 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-11, windows-2019] - bitness: [32, 64] include: # Run 32 and 64 bit version in parallel for Windows - - os: windows-2019 - bitness: 64 + - os: windows-2022 platform_id: win_amd64 - - os: windows-2019 - bitness: 32 + - os: windows-2022 platform_id: win32 - - os: macos-11 - bitness: 64 + - os: macos-13 platform_id: macosx_x86_64 - exclude: - - os: macos-11 - bitness: 32 + - os: macos-14 + platform_id: macosx_arm64 env: - CIBW_BUILD: cp38-${{ matrix.platform_id }} cp39-${{ matrix.platform_id }} cp310-${{ matrix.platform_id }} cp311-${{ matrix.platform_id }} cp312-${{ matrix.platform_id }} + CIBW_BUILD: cp38-${{ matrix.platform_id }} cp39-${{ matrix.platform_id }} cp310-${{ matrix.platform_id }} cp311-${{ matrix.platform_id }} cp312-${{ matrix.platform_id }} cp313-${{ matrix.platform_id }} CIBW_SKIP: pp* cp35* cp36* cp37* CIBW_BEFORE_BUILD_MACOS: "source packing/build_pango_mac.sh" CIBW_BEFORE_BUILD_WINDOWS: "python packing/download_dlls.py" CIBW_ENVIRONMENT_WINDOWS: "PKG_CONFIG_PATH='C:\\cibw\\vendor\\lib\\pkgconfig'" CIBW_ENVIRONMENT_MACOS: "PKG_CONFIG_PATH='/Users/runner/pangobuild/lib/pkgconfig'" - CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: python packing/inject-dlls.py {wheel} {dest_dir} C:\cibw\vendor\bin CIBW_TEST_REQUIRES: pytest pytest-cov CIBW_TEST_COMMAND: "bash {project}/packing/test_wheels.sh {project}" steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - name: Install Python - with: - python-version: "3.8" - - - name: Install cibuildwheel - env: - event_name: ${{ github.event_name }} - continue-on-error: true - shell: bash + - uses: actions/checkout@v4 + - name: Set Path for pkg-config + if: runner.os == 'windows' run: | - python -m pip install cibuildwheel==2.16.1 - echo "$event_name" + $env:Path = "C:\cibw\pkg-config\bin;C:\cibw\vendor\bin;$($env:PATH)" + echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Build wheels (Windows) if: runner.os == 'windows' + shell: pwsh run: | - $ErrorActionPreference = 'Stop' - $env:PATH="$env:PATH;C:\cibw\pkg-config\bin" - $env:PKG_CONFIG_PATH="C:\cibw\vendor\lib\pkgconfig" Copy-Item packing/LICENSE.bin . Rename-Item LICENSE.bin LICENSE.win32 - python -m cibuildwheel --output-dir wheelhouse - name: Build wheels (Non-Windows) if: runner.os != 'windows' run: | cp packing/LICENSE.bin . - python -m cibuildwheel --output-dir wheelhouse + + - name: Build wheels + uses: pypa/cibuildwheel@v2.20.0 + env: + PKG_CONFIG_PATH: "C:\\cibw\\vendor\\lib\\pkgconfig" - uses: actions/upload-artifact@v3 with: @@ -86,22 +72,13 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-11, windows-2019] - architecture: [x86, x64] - python-version: ['3.8', '3.9', '3.10', '3.11'] - include: - - os: windows-2019 - architecture: x64 - platform_id: win_amd64 - - os: windows-2019 - architecture: x86 - platform_id: win32 - - os: macos-11 - architecture: x64 - platform_id: macosx_x86_64 - exclude: - - os: macos-11 - architecture: x86 + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + include: [ + {os: windows-2022, platform_id: win_amd64, architecture: x64}, + {os: windows-2022, platform_id: win32, architecture: x86}, + {os: macos-13, platform_id: macosx_x86_64, architecture: x86_64}, + {os: macos-14, platform_id: macosx_arm64, architecture: arm64} + ] steps: - uses: actions/checkout@v3 diff --git a/.gitignore b/.gitignore index 3a8228e8..e165e89a 100644 --- a/.gitignore +++ b/.gitignore @@ -147,3 +147,4 @@ cython_debug/ #temp folder .pytest_temp +.venv*