-
Notifications
You must be signed in to change notification settings - Fork 395
77 lines (72 loc) · 2.28 KB
/
build_python_3.yml
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
name: Build Python 3
on:
workflow_call:
inputs:
cibw_build:
required: true
type: string
cibw_skip:
required: false
type: string
cibw_prerelease_pythons:
required: false
type: string
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
archs: x86_64 i686
- os: ubuntu-latest
archs: aarch64
- os: windows-latest
archs: AMD64 x86
- os: macos-12
archs: x86_64 universal2
steps:
- uses: actions/checkout@v3
# Include all history and tags
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
env:
# configure cibuildwheel to build native archs ('auto'), and some
# emulated ones
CIBW_ARCHS: ${{ matrix.archs }}
CIBW_BUILD: ${{ inputs.cibw_build }}
CIBW_SKIP: ${{ inputs.cibw_skip }}
CIBW_PRERELEASE_PYTHONS: ${{ inputs.cibw_prerelease_pythons }}
CMAKE_BUILD_PARALLEL_LEVEL: 12
CIBW_REPAIR_WHEEL_COMMAND_LINUX: |
mkdir ./tempwheelhouse &&
auditwheel repair -w ./tempwheelhouse {wheel} &&
(yum install -y zip || apk add zip) &&
for w in ./tempwheelhouse/*.whl; do
zip -d $w \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx
mv $w {dest_dir}
done &&
rm -rf ./tempwheelhouse
CIBW_REPAIR_WHEEL_COMMAND_MACOS: |
zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx &&
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS:
choco install -y 7zip &&
7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx &&
move "{wheel}" "{dest_dir}"
# DEV: Uncomment to debug MacOS
# CIBW_BUILD_VERBOSITY_MACOS: 3
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl