Skip to content

Commit

Permalink
Merge pull request #332 from lazka/arm64-wheels
Browse files Browse the repository at this point in the history
Build Windows wheels for arm64
  • Loading branch information
lazka authored Aug 30, 2023
2 parents a90de56 + 9b11297 commit f922a2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .ci/download-cairo-win32.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations
import logging
import os
import sys
import re
import shutil
import struct
Expand All @@ -13,6 +14,8 @@


def get_platform() -> str:
if len(sys.argv) > 1:
return sys.argv[1]
if (struct.calcsize("P") * 8) == 32:
return "x86"
else:
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,34 @@ on: [push, pull_request]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
name: Build wheels on ${{ matrix.os }} (${{ matrix.platform_id }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2019]
bitness: [32, 64]
include:
# Run 32 and 64 bit version in parallel for Windows
- os: windows-2019
bitness: 64
platform_id: win_amd64
cairo_plat: x64
- os: windows-2019
bitness: 32
platform_id: win32
cairo_plat: x86
- os: windows-2019
platform_id: win_arm64
cairo_plat: arm64

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_BUILD: "python {package}/.ci/download-cairo-win32.py"
CIBW_ARCHS_WINDOWS: "x86 ARM64 AMD64"
CIBW_BEFORE_BUILD: "python {package}/.ci/download-cairo-win32.py ${{ matrix.cairo_plat }}"
CIBW_BUILD: cp38-${{ matrix.platform_id }} cp39-${{ matrix.platform_id }} cp310-${{ matrix.platform_id }} cp311-${{ matrix.platform_id }} cp312-${{ matrix.platform_id }}
CIBW_TEST_REQUIRES: pytest hypothesis attrs
CIBW_TEST_COMMAND: bash {package}/.ci/test-wheels.sh {package}
CIBW_TEST_SKIP: "*-win_arm64"
CIBW_ENVIRONMENT_WINDOWS: PKG_CONFIG_PATH='${{ github.workspace }}/cairo-prebuild/lib/pkgconfig' PKG_CONFIG='${{ github.workspace }}/cairo-prebuild/bin/pkgconf.exe'

- uses: actions/upload-artifact@v3
Expand Down

0 comments on commit f922a2e

Please sign in to comment.