| 1 |
name: Build |
| 2 |
|
| 3 |
on: [push, pull_request] |
| 4 |
|
| 5 |
jobs: |
| 6 |
|
| 7 |
build_sdist: |
| 8 |
runs-on: ubuntu-latest |
| 9 |
|
| 10 |
steps: |
| 11 |
- uses: actions/checkout@v5 |
| 12 |
|
| 13 |
- name: Set up Python |
| 14 |
uses: actions/setup-python@v6 |
| 15 |
with: |
| 16 |
python-version: '3.11' |
| 17 |
|
| 18 |
- name: Install dependencies |
| 19 |
run: | |
| 20 |
sudo apt-get update |
| 21 |
sudo apt-get install -y libcairo2-dev pkg-config |
| 22 |
python -m pip install --upgrade build |
| 23 |
|
| 24 |
- name: Build sdist |
| 25 |
run: python -m build --sdist |
| 26 |
|
| 27 |
- uses: actions/upload-artifact@v5 |
| 28 |
with: |
| 29 |
name: sdist |
| 30 |
path: ./dist/*.tar.gz |
| 31 |
|
| 32 |
build_wheels: |
| 33 |
name: Build wheels on ${{ matrix.os }} (${{ matrix.platform_id }}) |
| 34 |
runs-on: ${{ matrix.os }} |
| 35 |
strategy: |
| 36 |
fail-fast: false |
| 37 |
matrix: |
| 38 |
include: |
| 39 |
- os: windows-2022 |
| 40 |
platform_id: win_amd64 |
| 41 |
arch: x64 |
| 42 |
- os: windows-2022 |
| 43 |
platform_id: win32 |
| 44 |
arch: x86 |
| 45 |
- os: windows-11-arm |
| 46 |
platform_id: win_arm64 |
| 47 |
arch: arm64 |
| 48 |
|
| 49 |
steps: |
| 50 |
- uses: actions/checkout@v5 |
| 51 |
|
| 52 |
- name: Setup MSVC |
| 53 |
uses: ilammy/[email protected] |
| 54 |
with: |
| 55 |
arch : ${{ matrix.arch }} |
| 56 |
|
| 57 |
- name: Build wheels |
| 58 |
uses: pypa/[email protected] |
| 59 |
env: |
| 60 |
CFLAGS: "-DCAIRO_WIN32_STATIC_BUILD=1" |
| 61 |
CIBW_BEFORE_BUILD: "python {package}/.ci/download-cairo-win32.py ${{ matrix.arch }}" |
| 62 |
CIBW_BUILD: cp310-${{ matrix.platform_id }} cp311-${{ matrix.platform_id }} cp312-${{ matrix.platform_id }} cp313-${{ matrix.platform_id }} cp314-${{ matrix.platform_id }} cp314t-${{ matrix.platform_id }} |
| 63 |
CIBW_SKIP: cp314t-win32 |
| 64 |
CIBW_TEST_REQUIRES: pytest==8.3.5 |
| 65 |
CIBW_TEST_COMMAND: bash {package}/.ci/test-wheels.sh {package} |
| 66 |
CIBW_ENVIRONMENT_WINDOWS: PKG_CONFIG_PATH='${{ github.workspace }}/cairo-prebuild/lib/pkgconfig' PKG_CONFIG='${{ github.workspace }}/cairo-prebuild/bin/pkgconf.exe' |
| 67 |
|
| 68 |
- uses: actions/upload-artifact@v5 |
| 69 |
with: |
| 70 |
name: "wheel-${{ matrix.arch }}" |
| 71 |
path: ./wheelhouse/*.whl |