-
Notifications
You must be signed in to change notification settings - Fork 27
156 lines (127 loc) · 4.25 KB
/
cling-wheels.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Build and upload to PyPI
on: [push]
jobs:
build-aarch64-wheels:
runs-on: ubuntu-latest
outputs:
job_number: ${{ steps.aarch64-job-number.outputs.job_number }}
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Trigger circleci build for ARM
id: aarch64-job-number
run: |
export JOB_NUMBER=$(python3 circleci.py job --token ${{ secrets.CIRCLE_API_TOKEN }})
echo "job_number=$JOB_NUMBER" >> "$GITHUB_OUTPUT"
build_wheels:
name: Build wheels on ${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_ARCHS: "${{ matrix.cibw.arch || 'auto' }}"
CLING_CMAKE_BUILD_TARGET: "${{ matrix.cibw.arch || '' }}"
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
VERBOSE: 1
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
name: mac-cpython
python: 310
platform_id: macosx_x86_64
# cross-compilation platform
- os: macos-latest
name: mac-cpython-arm
python: 310
platform_id: macosx_arm64
cibw:
arch: arm64
- os: ubuntu-latest
name: manylinux2014-x86_64
python: 310
platform_id: manylinux_x86_64
manylinux_image: manylinux2014
- os: ubuntu-latest
name: manylinux2014-i686
python: 310
platform_id: manylinux_i686
manylinux_image: manylinux2014
- os: windows-latest
name: win32
python: 310
platform_id: win32
- os: windows-latest
name: win_amd64
python: 310
platform_id: win_amd64
# cross-compilation platform (requires cross-compilation setup
# for cmake configuration)
#- os: windows-latest
# name: win32-arm64
# python: 310
# platform_id: win_arm64
# cibw:
# arch: ARM64
steps:
- uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v4
with:
python-version: "3.9"
architecture: ${{ matrix.architecture }}
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: customize mac-arm-64
if: contains(matrix.os, 'macos') && matrix.platform_id == 'macosx_arm64'
run: |
echo 'MACOSX_DEPLOYMENT_TARGET=10.15' >> "$GITHUB_ENV"
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.12.0
- name: list target wheels
run: |
python -m cibuildwheel cling --print-build-identifiers
- name: Build wheels
timeout-minutes: 600
run: |
python -m cibuildwheel cling --output-dir wheelhouse
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
run: cd cling && pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: ./cling/dist/*.tar.gz
upload_aarch64_wheel:
needs: [build_wheels, build-aarch64-wheels] # Just wait until this workflow is done - then aarch64 should be done
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Get wheel from CircleCI artifact
env:
JOB_NUMBER: ${{ needs.build-aarch64-wheels.outputs.job_number }}
run: |
export WHEEL_PATH=$(python circleci.py artifact --job-number $JOB_NUMBER --token ${{ secrets.CIRCLE_API_TOKEN }})
echo "wheel_path=$WHEEL_PATH" >> "$GITHUB_ENV"
- uses: actions/upload-artifact@v3
with:
path: ${{ env.wheel_path }}