Skip to content

Commit c08f9e8

Browse files
committed
Add workflow for python release.
1 parent 7072c41 commit c08f9e8

File tree

15 files changed

+428
-753
lines changed

15 files changed

+428
-753
lines changed

.github/workflows/wheels.yml

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
name: Build TsFile wheels(multi-platform)
2+
3+
on:
4+
push:
5+
branches:
6+
- "release_v*.*.*"
7+
pull_request:
8+
paths:
9+
- "cpp/**"
10+
- "python/**"
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
name: Build wheels on ${{ matrix.name }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- name: linux-x86_64
22+
os: ubuntu-22.04
23+
platform: linux
24+
cibw_archs_linux: "x86_64"
25+
26+
- name: linux-aarch64
27+
os: ubuntu-22.04-arm
28+
platform: linux
29+
cibw_archs_linux: "aarch64"
30+
31+
- name: macos-x86_64
32+
os: macos-13
33+
platform: macos
34+
cibw_archs_macos: "x86_64"
35+
36+
- name: macos-arm64
37+
os: macos-14
38+
platform: macos
39+
cibw_archs_macos: "arm64"
40+
# currently, compile on windows is not supported for cibuildwheel
41+
# - name: windows-amd64
42+
# os: windows-2022
43+
# platform: windows
44+
# cibw_archs_windows: "AMD64"
45+
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v4
49+
with:
50+
submodules: false
51+
fetch-depth: 0
52+
53+
- name: Set up Python
54+
uses: actions/setup-python@v4
55+
with:
56+
python-version: "3.11"
57+
58+
- name: Set up Java 17
59+
uses: actions/setup-java@v4
60+
with:
61+
distribution: temurin
62+
java-version: "17"
63+
64+
- name: Install system deps (macOS)
65+
if: matrix.platform == 'macos'
66+
run: |
67+
set -eux
68+
brew update
69+
brew install pkg-config || true
70+
71+
- name: Install build tools
72+
run: |
73+
python -m pip install -U pip wheel
74+
python -m pip install cibuildwheel==2.21.3
75+
76+
# - name: Build C++ core via Maven(win)
77+
# if: matrix.platform == 'windows'
78+
# shell: bash
79+
# run: |
80+
# set -euxo pipefail
81+
# chmod +x mvnw || true
82+
# ./mvnw -Pwith-cpp clean verify package \
83+
# -DskipTests -Dspotless.check.skip=true -Dspotless.apply.skip=true
84+
# test -d cpp/target/build/lib
85+
# test -d cpp/target/build/include
86+
87+
- name: Build C++ core via Maven (macOS)
88+
if: matrix.platform == 'macos'
89+
shell: bash
90+
env:
91+
MACOSX_DEPLOYMENT_TARGET: "12.0"
92+
CFLAGS: "-mmacosx-version-min=12.0"
93+
CXXFLAGS: "-mmacosx-version-min=12.0"
94+
LDFLAGS: "-mmacosx-version-min=12.0"
95+
run: |
96+
set -euxo pipefail
97+
chmod +x mvnw || true
98+
./mvnw -Pwith-cpp clean verify package \
99+
-DskipTests -Dspotless.check.skip=true -Dspotless.apply.skip=true \
100+
-Dcmake.args="-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0"
101+
otool -l cpp/target/build/lib/libtsfile*.dylib | grep -A2 LC_VERSION_MIN_MACOSX || true
102+
103+
- name: Build wheels via cibuildwheel
104+
if: matrix.platform != 'macos'
105+
env:
106+
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
107+
# CIBW_ARCHS_WINDOWS: ${{ matrix.cibw_archs_windows }}
108+
109+
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
110+
CIBW_SKIP: "pp* *-musllinux*"
111+
112+
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
113+
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
114+
115+
MACOSX_DEPLOYMENT_TARGET: "12.0"
116+
117+
CIBW_BEFORE_ALL_LINUX: |
118+
set -euxo pipefail
119+
if command -v yum >/dev/null 2>&1; then
120+
yum install -y wget tar gzip pkgconfig libuuid-devel libblkid-devel
121+
else
122+
echo "Not a yum-based image?" ; exit 1
123+
fi
124+
ARCH="$(uname -m)"
125+
mkdir -p /opt/java
126+
if [ "$ARCH" = "x86_64" ]; then
127+
JDK_URL="https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-x64_bin.tar.gz"
128+
else
129+
# aarch64
130+
JDK_URL="https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-aarch64_bin.tar.gz"
131+
fi
132+
curl -L -o /tmp/jdk17.tar.gz "$JDK_URL"
133+
tar -xzf /tmp/jdk17.tar.gz -C /opt/java
134+
export JAVA_HOME=$(echo /opt/java/jdk-17.0.12*)
135+
export PATH="$JAVA_HOME/bin:$PATH"
136+
java -version
137+
138+
chmod +x mvnw || true
139+
./mvnw -Pwith-cpp clean verify package \
140+
-DskipTests -Dspotless.check.skip=true -Dspotless.apply.skip=true
141+
test -d cpp/target/build/lib && test -d cpp/target/build/include
142+
143+
CIBW_TEST_COMMAND: >
144+
python -c "import tsfile, tsfile.tsfile_reader as r; print('import-ok:')"
145+
CIBW_BUILD_VERBOSITY: "1"
146+
run: cibuildwheel --output-dir wheelhouse python
147+
148+
- name: Build wheels via cibuildwheel (macOS)
149+
if: matrix.platform == 'macos'
150+
env:
151+
CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }}
152+
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-* cp314-*"
153+
# CIBW_BUILD: "cp313-*"
154+
CIBW_SKIP: "pp*"
155+
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=12.0"
156+
MACOSX_DEPLOYMENT_TARGET: "12.0"
157+
CIBW_TEST_COMMAND: >
158+
python -c "import tsfile, tsfile.tsfile_reader as r; print('import-ok:')"
159+
CIBW_BUILD_VERBOSITY: "1"
160+
run: cibuildwheel --output-dir wheelhouse python
161+
162+
- name: Upload wheels as artifact
163+
uses: actions/upload-artifact@v4
164+
with:
165+
name: tsfile-wheels-${{ matrix.name }}
166+
path: wheelhouse/*.whl
167+
168+

cpp/pom.xml

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.apache.tsfile</groupId>
2424
<artifactId>tsfile-parent</artifactId>
25-
<version>2.2.0-SNAPSHOT</version>
25+
<version>2.1.2</version>
2626
</parent>
2727
<artifactId>tsfile-cpp</artifactId>
2828
<packaging>pom</packaging>
@@ -151,39 +151,6 @@
151151
</plugins>
152152
</build>
153153
<profiles>
154-
<profile>
155-
<id>linux-install-uuid-dev</id>
156-
<activation>
157-
<os>
158-
<family>unix</family>
159-
<name>Linux</name>
160-
</os>
161-
</activation>
162-
<build>
163-
<plugins>
164-
<plugin>
165-
<groupId>org.codehaus.mojo</groupId>
166-
<artifactId>exec-maven-plugin</artifactId>
167-
<executions>
168-
<execution>
169-
<id>install-uuid-dev</id>
170-
<phase>validate</phase>
171-
<goals>
172-
<goal>exec</goal>
173-
</goals>
174-
</execution>
175-
</executions>
176-
<configuration>
177-
<executable>bash</executable>
178-
<arguments>
179-
<argument>-c</argument>
180-
<argument>sudo apt-get update &amp;&amp; sudo apt-get install -y uuid-dev</argument>
181-
</arguments>
182-
</configuration>
183-
</plugin>
184-
</plugins>
185-
</build>
186-
</profile>
187154
<!-- When running on jenkins, download the sonar build-wrapper, so we can do a code analysis -->
188155
<profile>
189156
<id>jenkins-build</id>

cpp/src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ set(ANTLR4_WITH_STATIC_CRT OFF)
3636
set(PROJECT_INCLUDE_DIR
3737
${CMAKE_SOURCE_DIR}/src
3838
${THIRD_PARTY_INCLUDE}/google_snappy
39+
${THIRD_PARTY_INCLUDE}/zlib-1.2.13
3940
${CMAKE_SOURCE_DIR}/third_party/lz4
4041
${CMAKE_SOURCE_DIR}/third_party/lzokay
4142
${CMAKE_SOURCE_DIR}/third_party/zlib-1.2.13

cpp/test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ include_directories(
8080
${LIBRARY_INCLUDE_DIR}
8181
${THIRD_PARTY_INCLUDE}
8282
${THIRD_PARTY_INCLUDE}/google_snappy
83+
${THIRD_PARTY_INCLUDE}/zlib-1.2.13
8384
${CMAKE_SOURCE_DIR}/third_party/lz4
8485
${CMAKE_SOURCE_DIR}/third_party/google_snappy
8586
${CMAKE_SOURCE_DIR}/third_party/lzokay

0 commit comments

Comments
 (0)