-
Notifications
You must be signed in to change notification settings - Fork 93
286 lines (249 loc) · 8.84 KB
/
wheels.yml
File metadata and controls
286 lines (249 loc) · 8.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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
name: Build TsFile wheels(multi-platform)
on:
push:
branches:
- "rc/**"
workflow_dispatch:
jobs:
build:
name: Build wheels on ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-x86_64
os: ubuntu-22.04
platform: linux
cibw_archs_linux: "x86_64"
- name: linux-aarch64
os: ubuntu-22.04-arm
platform: linux
cibw_archs_linux: "aarch64"
- name: macos-x86_64
os: macos-15-intel
platform: macos
cibw_archs_macos: "x86_64"
- name: macos-arm64
os: macos-latest
platform: macos
cibw_archs_macos: "arm64"
# Windows is handled by the build-windows job below
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Set up Java 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
- name: Install system deps (macOS)
if: matrix.platform == 'macos'
run: |
set -eux
brew update
brew install pkg-config || true
- name: Install build tools
run: |
python -m pip install -U pip wheel
python -m pip install cibuildwheel==2.21.3
- name: Pre-download virtualenv for cibuildwheel
run: |
if [ "$(uname)" = "Darwin" ]; then
CACHE_DIR="$HOME/Library/Caches/cibuildwheel"
else
CACHE_DIR="$HOME/.cache/cibuildwheel"
fi
mkdir -p "$CACHE_DIR"
TARGET="$CACHE_DIR/virtualenv-20.26.6.pyz"
if [ ! -f "$TARGET" ]; then
curl -sSL --retry 5 --retry-delay 15 --retry-all-errors \
-o "$TARGET" \
"https://github.com/pypa/get-virtualenv/raw/20.26.6/public/virtualenv.pyz"
fi
ls -la "$TARGET"
- name: Build C++ core via Maven (macOS)
if: matrix.platform == 'macos'
shell: bash
env:
MACOSX_DEPLOYMENT_TARGET: "12.0"
CFLAGS: "-mmacosx-version-min=12.0"
CXXFLAGS: "-mmacosx-version-min=12.0"
LDFLAGS: "-mmacosx-version-min=12.0"
run: |
set -euxo pipefail
chmod +x mvnw || true
./mvnw -Pwith-cpp clean package \
-DskipTests -Dspotless.check.skip=true -Dspotless.apply.skip=true \
-Dbuild.test=OFF \
-Dcmake.args="-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0"
otool -l cpp/target/build/lib/libtsfile*.dylib | grep -A2 LC_VERSION_MIN_MACOSX || true
- name: Build wheels via cibuildwheel
if: matrix.platform != 'macos'
env:
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
# CIBW_ARCHS_WINDOWS: ${{ matrix.cibw_archs_windows }}
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
CIBW_SKIP: "pp* *-musllinux*"
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
MACOSX_DEPLOYMENT_TARGET: "12.0"
CIBW_BEFORE_ALL_LINUX: |
set -euxo pipefail
if command -v yum >/dev/null 2>&1; then
yum install -y wget tar gzip pkgconfig libuuid-devel libblkid-devel
else
echo "Not a yum-based image?" ; exit 1
fi
ARCH="$(uname -m)"
mkdir -p /opt/java
if [ "$ARCH" = "x86_64" ]; then
JDK_URL="https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-x64_bin.tar.gz"
else
# aarch64
JDK_URL="https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-aarch64_bin.tar.gz"
fi
curl -L -o /tmp/jdk17.tar.gz "$JDK_URL"
tar -xzf /tmp/jdk17.tar.gz -C /opt/java
export JAVA_HOME=$(echo /opt/java/jdk-17.0.12*)
export PATH="$JAVA_HOME/bin:$PATH"
java -version
chmod +x mvnw || true
./mvnw -Pwith-cpp clean package \
-DskipTests -Dbuild.test=OFF \
-Dspotless.check.skip=true -Dspotless.apply.skip=true
test -d cpp/target/build/lib && test -d cpp/target/build/include
CIBW_TEST_COMMAND: >
python -c "import tsfile, tsfile.tsfile_reader as r; print('import-ok:')"
CIBW_BUILD_VERBOSITY: "1"
run: cibuildwheel --output-dir wheelhouse python
- name: Build wheels via cibuildwheel (macOS)
if: matrix.platform == 'macos'
env:
CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }}
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
# CIBW_BUILD: "cp313-*"
CIBW_SKIP: "pp*"
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=12.0"
MACOSX_DEPLOYMENT_TARGET: "12.0"
CIBW_TEST_COMMAND: >
python -c "import tsfile, tsfile.tsfile_reader as r; print('import-ok:')"
CIBW_BUILD_VERBOSITY: "1"
run: cibuildwheel --output-dir wheelhouse python
- name: Upload wheels as artifact
uses: actions/upload-artifact@v7
with:
name: tsfile-wheels-${{ matrix.name }}
path: wheelhouse/*.whl
# ── Windows: build C++ once, then build wheels for each Python version ──
build-windows-cpp:
name: Build C++ core (Windows)
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 0
- name: Set up Java 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
- name: Set up MSYS2 / MinGW
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-make
make
- name: Build C++ core via Maven
shell: msys2 {0}
run: |
set -euxo pipefail
export JAVA_HOME="$(cygpath "$JAVA_HOME")"
export PATH="$JAVA_HOME/bin:$PATH"
java -version
chmod +x mvnw || true
./mvnw -Pwith-cpp clean package \
-DskipTests -Dbuild.test=OFF \
-Dspotless.check.skip=true -Dspotless.apply.skip=true
test -d cpp/target/build/lib
test -d cpp/target/build/include
- name: Upload C++ build output
uses: actions/upload-artifact@v7
with:
name: tsfile-cpp-windows
path: |
cpp/target/build/lib/
cpp/target/build/include/
build-windows-wheels:
name: Build wheel (Windows, Python ${{ matrix.python-version }})
needs: build-windows-cpp
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Set up Java 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
- name: Set up MSYS2 / MinGW
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
make
- name: Download C++ build output
uses: actions/download-artifact@v4
with:
name: tsfile-cpp-windows
path: cpp/target/build/
- name: Build wheel
shell: msys2 {0}
run: |
set -euxo pipefail
export JAVA_HOME="$(cygpath "$JAVA_HOME")"
export PYTHON_HOME="$(cygpath "$pythonLocation")"
export PATH="$PYTHON_HOME:$PYTHON_HOME/Scripts:$JAVA_HOME/bin:$PATH"
# Build wheel via Maven (no clean — keep C++ artifacts from previous job)
chmod +x mvnw || true
cd python
../mvnw package -DskipTests \
-Dspotless.check.skip=true -Dspotless.apply.skip=true
ls -la dist/
- name: Verify wheel
shell: bash
run: |
python -m pip install python/dist/*.whl
python -c "import tsfile, tsfile.tsfile_reader as r; print('import-ok')"
- name: Upload wheel
uses: actions/upload-artifact@v7
with:
name: tsfile-wheels-windows-py${{ matrix.python-version }}
path: python/dist/*.whl