Skip to content

Commit

Permalink
CI: fix windows wheels build
Browse files Browse the repository at this point in the history
also some general improvements
  • Loading branch information
naveen521kk committed Sep 13, 2024
1 parent 170c7dd commit d1d0fbb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 47 deletions.
71 changes: 24 additions & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,4 @@ cython_debug/

#temp folder
.pytest_temp
.venv*

0 comments on commit d1d0fbb

Please sign in to comment.