-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (74 loc) · 2.84 KB
/
Copy pathreuseable_cibuildwheel.yml
File metadata and controls
83 lines (74 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: cibuildwheel
on:
workflow_call:
inputs:
auto:
description: Build wheels for auto archs
required: true
type: boolean
extra:
description: Build wheels for aarch64 armv7l ppc64le & s390x
required: true
type: boolean
jobs:
build_wheels:
name: ${{ matrix.os }}, ${{ matrix.arch }}, ${{ matrix.build }} wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
arch: [aarch64, ppc64le, s390x, x86_64, i686]
build: [manylinux, musllinux]
qemu_arch: [aarch64 ppc64le s390x armv7l]
include:
- {os: windows-2019, arch: AMD64, build: win}
- {os: windows-2019, arch: x86, build: win}
- {os: windows-2022, arch: ARM64, build: win}
- {os: macos-13, arch: x86_64, build: macos}
- {os: macos-14, arch: arm64, build: macos}
steps:
- uses: actions/checkout@v4
if: >
inputs.auto && !contains(matrix.qemu_arch, matrix.arch) ||
inputs.extra && contains(matrix.qemu_arch, matrix.arch)
with:
fetch-depth: 0
- name: Set up msvc on Windows
if: runner.os == 'Windows' && inputs.auto && !contains(matrix.qemu_arch, matrix.arch)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: runner.os == 'Linux' && inputs.extra && contains(matrix.qemu_arch, matrix.arch)
- name: Cache
if: >
inputs.auto && !contains(matrix.qemu_arch, matrix.arch) ||
inputs.extra && contains(matrix.qemu_arch, matrix.arch)
uses: actions/cache@v4
with:
path: |
~/.cache/vcpkg
~/AppData/Local/vcpkg
key: cache-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.build }}-${{ hashFiles('vcpkg.json') }}
restore-keys: cache-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.build }}-${{ hashFiles('vcpkg.json') }}
- name: Build wheels
if: >
inputs.auto && !contains(matrix.qemu_arch, matrix.arch) ||
inputs.extra && contains(matrix.qemu_arch, matrix.arch)
uses: pypa/cibuildwheel@v2.23.3
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: '*${{ matrix.build }}*'
CIBW_BEFORE_ALL_LINUX: >
mkdir -p ~/.cache || true &&
mkdir -p /host/home/runner/.cache/vcpkg || true &&
ln -s /host/home/runner/.cache/vcpkg ~/.cache/vcpkg || true
- name: Upload wheels
if: >
inputs.auto && !contains(matrix.qemu_arch, matrix.arch) ||
inputs.extra && contains(matrix.qemu_arch, matrix.arch)
uses: actions/upload-artifact@v4
with:
name: cibw-${{ matrix.os }}-${{ matrix.build }}-${{ matrix.arch }}
path: wheelhouse/*.whl