-
Notifications
You must be signed in to change notification settings - Fork 624
165 lines (142 loc) · 4.39 KB
/
build-wheels-cpu.yaml
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
157
158
159
160
161
162
163
164
165
name: Build Wheels (CPU)
on: workflow_dispatch
permissions:
contents: write
jobs:
# build_wheels_linux:
# name: Build wheels on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-20.04]
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: "recursive"
# # Used to host cibuildwheel
# - uses: actions/setup-python@v5
# with:
# python-version: "3.8"
# cache: "pip"
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# # python -m pip install -e .
# python -m pip install build wheel
# - name: Build wheels
# uses: pypa/cibuildwheel@v2.20.0
# env:
# # disable repair
# CIBW_REPAIR_WHEEL_COMMAND: ""
# CIBW_BUILD_FRONTEND: "build"
# CIBW_SKIP: "*musllinux*"
# CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-*"
# CMAKE_BUILD_PARALLEL_LEVEL: 4
# with:
# package-dir: .
# output-dir: wheelhouse
# - uses: actions/upload-artifact@v4
# with:
# name: wheels-${{ matrix.os }}
# path: ./wheelhouse/*.whl
build_wheels_win:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# here 'sdk-windows-8-core' is a large runner
os: [sdk-windows-8-core]
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
# Used to host cibuildwheel
- uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# python -m pip install -e .
python -m pip install build wheel
- name: Build wheels
uses: pypa/cibuildwheel@v2.20.0
env:
# disable repair
CIBW_REPAIR_WHEEL_COMMAND: ""
CIBW_BUILD_FRONTEND: "build"
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*"
CMAKE_BUILD_PARALLEL_LEVEL: 16
CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_ARGS="-DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION=10.0.18362.0"'
with:
package-dir: .
output-dir: wheelhouse
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_wheels_arm64:
name: Build arm64 wheels
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64
- name: Build wheels
uses: pypa/cibuildwheel@v2.20.0
env:
CIBW_REPAIR_WHEEL_COMMAND: ""
CIBW_BUILD_FRONTEND: "build"
CIBW_SKIP: "*musllinux* pp*"
CIBW_ARCHS: "aarch64"
CIBW_BUILD: "cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*"
CMAKE_BUILD_PARALLEL_LEVEL: $(nproc)
with:
output-dir: wheelhouse
- name: Upload wheels as artifacts
uses: actions/upload-artifact@v4
with:
name: wheels_arm64
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip build
python -m pip install -e .
- name: Build source distribution
run: |
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: ./dist/*.tar.gz
release:
name: Release
needs: [build_wheels_win, build_wheels_arm64, build_sdist] # build_wheels_linux
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist
- uses: softprops/action-gh-release@v2
with:
files: dist/*
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}