From d7a1867ec8dbe33e45255ddf83d0fd5c30019c90 Mon Sep 17 00:00:00 2001 From: HTHou Date: Mon, 15 Jun 2026 10:19:13 +0800 Subject: [PATCH 1/8] Release thrift 0.23.0 tool --- iotdb-tools-thrift/pom.xml | 47 ++++++++----------- .../src/main/assembly/thrift.xml | 26 ---------- 2 files changed, 19 insertions(+), 54 deletions(-) diff --git a/iotdb-tools-thrift/pom.xml b/iotdb-tools-thrift/pom.xml index 0de594d..0b06a97 100644 --- a/iotdb-tools-thrift/pom.xml +++ b/iotdb-tools-thrift/pom.xml @@ -33,18 +33,14 @@ contains nothing else as the compiled thrift binary without any modification. The fourth segment allows us to re-deploy, if we need to change the config. --> - 0.20.0.0 + 0.23.0.0 pom IoTDB-Tools: Thrift Local build of the Apache Thrift compiler. - 0.20.0 - ON - ON - ON - ON + 0.23.0 Unix Makefiles Release @@ -96,48 +92,39 @@ + + + - - + - + - - + + + + - + - + - - - - - - - - - - - - - @@ -159,8 +146,7 @@ org.apache.maven.plugins @@ -208,6 +194,11 @@ + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.7.1 + com.googlecode.cmake-maven-project cmake-maven-plugin diff --git a/iotdb-tools-thrift/src/main/assembly/thrift.xml b/iotdb-tools-thrift/src/main/assembly/thrift.xml index ce0de79..fb0c7b1 100644 --- a/iotdb-tools-thrift/src/main/assembly/thrift.xml +++ b/iotdb-tools-thrift/src/main/assembly/thrift.xml @@ -35,31 +35,5 @@ bin - - - ${project.build.directory}/build - - lib/*.a - lib/Release/*.lib - lib/Debug/*.lib - - / - - - - ${project.build.directory}/thrift-${thrift.version}/lib/cpp/src - - ** - - include - - - - ${project.build.directory}/build/thrift - - config.h - - include/thrift - From ab417206863bdb2cae9edbcfa443eeabe5cdc9ea Mon Sep 17 00:00:00 2001 From: HTHou Date: Mon, 15 Jun 2026 10:44:09 +0800 Subject: [PATCH 2/8] Document thrift release deployment flow --- iotdb-tools-thrift/README.md | 59 ++++++++++++++++++------- iotdb-tools-thrift/README_zh.md | 78 +++++++++++++++++++++++++++++++++ iotdb-tools-thrift/pom.xml | 23 +++++++++- 3 files changed, 143 insertions(+), 17 deletions(-) create mode 100644 iotdb-tools-thrift/README_zh.md diff --git a/iotdb-tools-thrift/README.md b/iotdb-tools-thrift/README.md index f26c8eb..e746df6 100644 --- a/iotdb-tools-thrift/README.md +++ b/iotdb-tools-thrift/README.md @@ -21,31 +21,58 @@ # Releasing the IoTDB Tools: Thrift - ./mvnw clean deploy -P apache-release +This module publishes platform-specific Apache Thrift compiler archives used by +IoTDB builds. The archives contain the `thrift` executable only. + +## Prerequisites + +Install the following software before building this module: + +- JDK +- Flex +- Bison +- A C/C++ build toolchain supported by CMake +- GPG configured for Apache release signing +- Apache Nexus credentials configured as `apache.releases.https` in Maven `settings.xml` + +Linux static builds may also need static zlib and OpenSSL development packages. -On the first run, comment out the "stagingRepositoryId" property. -This will make the build deploy the rc in a new staging repository in nexus. +Use `mvnw.cmd` instead of `./mvnw` on Windows. -As soon as the build is finished, go to https://repository.apache.org/#stagingRepositories and take the new repository id from there and comment in the property again and update the value to that of the staging repository and commit that. +## Build Locally -This will make it easy for the other platform deployment. +Run the following command from this directory: -Then checkout the repo on the other platforms and run the following on each of the other platforms: + ./mvnw clean package -DskipTests + +The archive is generated under `target/`. Check that it contains `bin/thrift` +and that the binary reports the expected Apache Thrift version. + +## Deploy to Nexus + +Run the first deploy on one platform without `stagingRepositoryId`: ./mvnw clean deploy -P apache-release -> Note: For some reason you will see errors a the end when deploying the other artifacts, however in all cases I did see the artifacts deployed correctly. +This creates a new staging repository in Nexus. After the deploy completes, open +https://repository.apache.org/#stagingRepositories and copy the generated staging +repository id, for example `orgapacheiotdb-1234`. -Once this has been run on each of the supported platforms, go back to Nexus and close the staging repository. +Run the deploy on each remaining platform with that exact staging repository id: -## Prerequisites + ./mvnw clean deploy -P apache-release -DstagingRepositoryId=orgapacheiotdb-1234 -The following software needs to be installed in order to build the thrift module: +The `stagingRepositoryId` value must be an existing Nexus staging repository id +created by the first deploy. Do not use a made-up id. -- Java -- Flex -- Bison -- Boost -- Ssl +Supported classifiers are selected by the active OS profile: + +- `linux-x86_64` +- `linux-aarch64` +- `mac-x86_64` +- `mac-aarch64` +- `windows-x86_64` +- `windows-aarch64` -Please look in the IoTDB documentation for information on how to install them on your particular OS. +After all platform archives have been deployed, verify the staging repository in +Nexus, close it, and continue with the Apache release vote and release process. diff --git a/iotdb-tools-thrift/README_zh.md b/iotdb-tools-thrift/README_zh.md new file mode 100644 index 0000000..89bcc3f --- /dev/null +++ b/iotdb-tools-thrift/README_zh.md @@ -0,0 +1,78 @@ + + +# 发布 IoTDB Tools: Thrift + +本模块用于发布 IoTDB 构建过程中使用的、按平台区分的 Apache Thrift +compiler 压缩包。压缩包中只包含 `thrift` 可执行文件。 + +## 环境准备 + +构建本模块前需要安装以下软件: + +- JDK +- Flex +- Bison +- CMake 支持的 C/C++ 构建工具链 +- 已配置好 Apache 发布签名的 GPG +- 在 Maven `settings.xml` 中配置好 server id 为 `apache.releases.https` 的 Apache Nexus 凭据 + +Linux 静态构建可能还需要安装 zlib 和 OpenSSL 的静态开发包。 + +Windows 上请使用 `mvnw.cmd` 替代 `./mvnw`。 + +## 本地构建 + +在当前目录执行: + + ./mvnw clean package -DskipTests + +构建产物会生成到 `target/` 目录下。请确认压缩包中包含 `bin/thrift`,并确认该 +二进制文件输出的 Apache Thrift 版本符合预期。 + +## 发布到 Nexus + +先在一个平台上执行第一次 deploy,不要传入 `stagingRepositoryId`: + + ./mvnw clean deploy -P apache-release + +这一步会在 Nexus 中创建新的 staging repository。deploy 完成后,打开 +https://repository.apache.org/#stagingRepositories,复制新创建出来的 staging +repository id,例如 `orgapacheiotdb-1234`。 + +然后在其余平台上执行 deploy,并传入第一次创建出来的 staging repository id: + + ./mvnw clean deploy -P apache-release -DstagingRepositoryId=orgapacheiotdb-1234 + +`stagingRepositoryId` 必须是第一次 deploy 后 Nexus 里真实存在的 staging +repository id,不能随便填写一个不存在的 id。 + +支持的平台 classifier 由当前操作系统激活的 Maven profile 决定: + +- `linux-x86_64` +- `linux-aarch64` +- `mac-x86_64` +- `mac-aarch64` +- `windows-x86_64` +- `windows-aarch64` + +所有平台压缩包都 deploy 完成后,在 Nexus 中检查 staging repository,确认无误后 +close,然后继续 Apache release vote 和 release 流程。 diff --git a/iotdb-tools-thrift/pom.xml b/iotdb-tools-thrift/pom.xml index 0b06a97..55cd8cb 100644 --- a/iotdb-tools-thrift/pom.xml +++ b/iotdb-tools-thrift/pom.xml @@ -222,7 +222,6 @@ apache.releases.https https://repository.apache.org true - orgapacheiotdb-1158 @@ -230,6 +229,28 @@ + + reuse-staging-repository + + + stagingRepositoryId + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + + ${stagingRepositoryId} + + + + + + + .os-unix From 6a2f0099f183b87bf2fbc0f79ed8529f4f0cdf56 Mon Sep 17 00:00:00 2001 From: HTHou Date: Mon, 15 Jun 2026 10:47:05 +0800 Subject: [PATCH 3/8] Clarify thrift Linux build prerequisites --- iotdb-tools-thrift/README.md | 3 ++- iotdb-tools-thrift/README_zh.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/iotdb-tools-thrift/README.md b/iotdb-tools-thrift/README.md index e746df6..9e44aca 100644 --- a/iotdb-tools-thrift/README.md +++ b/iotdb-tools-thrift/README.md @@ -35,7 +35,8 @@ Install the following software before building this module: - GPG configured for Apache release signing - Apache Nexus credentials configured as `apache.releases.https` in Maven `settings.xml` -Linux static builds may also need static zlib and OpenSSL development packages. +Linux profiles build the `thrift` executable with `-static`, so the build host +needs the static runtime libraries required by its C/C++ toolchain. Use `mvnw.cmd` instead of `./mvnw` on Windows. diff --git a/iotdb-tools-thrift/README_zh.md b/iotdb-tools-thrift/README_zh.md index 89bcc3f..23c1793 100644 --- a/iotdb-tools-thrift/README_zh.md +++ b/iotdb-tools-thrift/README_zh.md @@ -35,7 +35,8 @@ compiler 压缩包。压缩包中只包含 `thrift` 可执行文件。 - 已配置好 Apache 发布签名的 GPG - 在 Maven `settings.xml` 中配置好 server id 为 `apache.releases.https` 的 Apache Nexus 凭据 -Linux 静态构建可能还需要安装 zlib 和 OpenSSL 的静态开发包。 +Linux profile 会用 `-static` 链接 `thrift` 可执行文件,因此构建机器需要具备 +当前 C/C++ 工具链静态链接所需的运行时库。 Windows 上请使用 `mvnw.cmd` 替代 `./mvnw`。 From 2f1d39d321f928e821693bf52a18185297eb019c Mon Sep 17 00:00:00 2001 From: HTHou Date: Mon, 15 Jun 2026 11:07:38 +0800 Subject: [PATCH 4/8] Add thrift prebuilt artifact workflow --- .github/dependabot.yml | 25 +++ .../iotdb-tools-thrift-artifacts.yml | 187 ++++++++++++++++++ .gitignore | 1 + iotdb-tools-thrift/README.md | 65 +++++- iotdb-tools-thrift/README_zh.md | 62 +++++- iotdb-tools-thrift/pom.xml | 96 +++++++++ 6 files changed, 426 insertions(+), 10 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/iotdb-tools-thrift-artifacts.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..fd23ac2 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,25 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/iotdb-tools-thrift-artifacts.yml b/.github/workflows/iotdb-tools-thrift-artifacts.yml new file mode 100644 index 0000000..86f1099 --- /dev/null +++ b/.github/workflows/iotdb-tools-thrift-artifacts.yml @@ -0,0 +1,187 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Build IoTDB Tools Thrift Artifacts + +on: + workflow_dispatch: + inputs: + git_ref: + description: Optional branch, tag, or commit SHA to build + required: false + type: string + +permissions: + contents: read + +concurrency: + group: iotdb-tools-thrift-artifacts-${{ github.ref }} + cancel-in-progress: false + +jobs: + build: + name: Build ${{ matrix.classifier }} + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - classifier: linux-x86_64 + runner: ubuntu-24.04 + platform: linux + maven: ./mvnw + - classifier: linux-aarch64 + runner: ubuntu-24.04-arm + platform: linux + maven: ./mvnw + - classifier: mac-x86_64 + runner: macos-15-intel + platform: macos + maven: ./mvnw + - classifier: mac-aarch64 + runner: macos-15 + platform: macos + maven: ./mvnw + - classifier: windows-x86_64 + runner: windows-2022 + platform: windows + maven: .\mvnw.cmd + - classifier: windows-aarch64 + runner: windows-11-arm + platform: windows + maven: .\mvnw.cmd + + steps: + - name: Check out source + uses: actions/checkout@v4 + with: + ref: ${{ inputs.git_ref || github.ref }} + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + cache: maven + + - name: Install Linux build prerequisites + if: matrix.platform == 'linux' + run: | + sudo apt-get update + sudo apt-get install -y flex bison g++ make + + - name: Install macOS build prerequisites + if: matrix.platform == 'macos' + run: brew install bison + + - name: Install Windows build prerequisites + if: matrix.platform == 'windows' + shell: pwsh + run: choco install winflexbison3 -y --no-progress + + - name: Verify active Maven classifier + working-directory: iotdb-tools-thrift + shell: pwsh + run: | + $expected = "${{ matrix.classifier }}" + $actual = & "${{ matrix.maven }}" -q help:evaluate "-Dexpression=os.classifier" "-DforceStdout" + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + $actual = ($actual | Select-Object -Last 1).Trim() + Write-Host "Expected classifier: $expected" + Write-Host "Maven classifier: $actual" + if ($actual -ne $expected) { + throw "Maven activated classifier '$actual', expected '$expected'" + } + + - name: Build artifact + working-directory: iotdb-tools-thrift + shell: pwsh + run: | + & "${{ matrix.maven }}" clean package -DskipTests + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + - name: Verify archive contents + working-directory: iotdb-tools-thrift + shell: pwsh + run: | + $classifier = "${{ matrix.classifier }}" + $zip = Get-ChildItem -Path target -Filter "*-$classifier.zip" | Select-Object -First 1 + if (-not $zip) { + throw "No zip file found for classifier $classifier" + } + + Add-Type -AssemblyName System.IO.Compression.FileSystem + $archive = [System.IO.Compression.ZipFile]::OpenRead($zip.FullName) + try { + $files = $archive.Entries | Where-Object { $_.Name } | ForEach-Object { $_.FullName } + } finally { + $archive.Dispose() + } + + $expectedBinary = if ($classifier.StartsWith("windows")) { "bin/thrift.exe" } else { "bin/thrift" } + Write-Host "Archive: $($zip.Name)" + $files | ForEach-Object { Write-Host " - $_" } + + if ($files.Count -ne 1) { + throw "Expected exactly one file in the archive, found $($files.Count)" + } + if ($files -notcontains $expectedBinary) { + throw "Expected archive to contain $expectedBinary" + } + + - name: Upload platform artifact + uses: actions/upload-artifact@v4 + with: + name: iotdb-tools-thrift-${{ matrix.classifier }} + path: iotdb-tools-thrift/target/*-${{ matrix.classifier }}.zip + if-no-files-found: error + compression-level: 0 + retention-days: 14 + + bundle: + name: Bundle all platform artifacts + runs-on: ubuntu-24.04 + needs: build + steps: + - name: Download platform artifacts + uses: actions/download-artifact@v4 + with: + path: dist + pattern: iotdb-tools-thrift-* + merge-multiple: true + + - name: Verify bundled artifacts + shell: bash + run: | + set -euo pipefail + ls -lah dist + test "$(find dist -maxdepth 1 -name '*.zip' | wc -l)" -eq 6 + + - name: Upload bundled artifact + uses: actions/upload-artifact@v4 + with: + name: iotdb-tools-thrift-all-platforms + path: dist/*.zip + if-no-files-found: error + compression-level: 0 + retention-days: 14 diff --git a/.gitignore b/.gitignore index dceb35b..bb3e9b2 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ **/.DS_Store derby-tsfile-db /iotdb-tools-thrift/target/ +/iotdb-tools-thrift/prebuilt-artifacts/ /iotdb-tools-thrift/.mvn/wrapper/maven-wrapper.jar diff --git a/iotdb-tools-thrift/README.md b/iotdb-tools-thrift/README.md index 9e44aca..a8fa1fd 100644 --- a/iotdb-tools-thrift/README.md +++ b/iotdb-tools-thrift/README.md @@ -49,7 +49,65 @@ Run the following command from this directory: The archive is generated under `target/`. Check that it contains `bin/thrift` and that the binary reports the expected Apache Thrift version. -## Deploy to Nexus +## Build Release Artifacts With GitHub Actions + +The `Build IoTDB Tools Thrift Artifacts` workflow builds the six platform zip +artifacts without signing or deploying them. Trigger it manually from GitHub +Actions, optionally passing a branch, tag, or commit SHA in the `git_ref` input. + +The workflow uploads one bundled artifact named +`iotdb-tools-thrift-all-platforms`. Download and extract that artifact into this +directory: + + iotdb-tools-thrift/prebuilt-artifacts/ + +If you use the GitHub CLI, run: + + gh run download --name iotdb-tools-thrift-all-platforms --dir prebuilt-artifacts + +The directory must contain these files: + +- `iotdb-tools-thrift-${project.version}-linux-x86_64.zip` +- `iotdb-tools-thrift-${project.version}-linux-aarch64.zip` +- `iotdb-tools-thrift-${project.version}-mac-x86_64.zip` +- `iotdb-tools-thrift-${project.version}-mac-aarch64.zip` +- `iotdb-tools-thrift-${project.version}-windows-x86_64.zip` +- `iotdb-tools-thrift-${project.version}-windows-aarch64.zip` + +`${project.version}` is the Maven project version, for example `0.23.0.0`. + +Verify the archives before deploying them. Each archive should contain only the +`bin/thrift` executable, or `bin/thrift.exe` on Windows, and the executable +should report the expected Apache Thrift version. + +## Deploy Prebuilt Artifacts to Nexus + +Run the deploy locally from this directory. This signs and deploys the six +prebuilt platform artifacts from `prebuilt-artifacts/`: + + ./mvnw clean deploy -P apache-release,prebuilt-artifacts + +Use `prebuilt.artifacts.dir` if the downloaded artifacts are in another +directory: + + ./mvnw clean deploy -P apache-release,prebuilt-artifacts -Dprebuilt.artifacts.dir=/path/to/prebuilt-artifacts + +This creates a new staging repository in Nexus. After the deploy completes, open +https://repository.apache.org/#stagingRepositories and verify the uploaded +artifacts. + +If you need to re-run the local deploy into an existing staging repository, pass +that exact staging repository id: + + ./mvnw clean deploy -P apache-release,prebuilt-artifacts -DstagingRepositoryId=orgapacheiotdb-1234 + +The `stagingRepositoryId` value must be an existing Nexus staging repository id. +Do not use a made-up id. + +## Deploy by Building on Each Platform + +If you do not use the prebuilt artifacts workflow, you can still deploy by +building on each platform. Run the first deploy on one platform without `stagingRepositoryId`: @@ -63,10 +121,7 @@ Run the deploy on each remaining platform with that exact staging repository id: ./mvnw clean deploy -P apache-release -DstagingRepositoryId=orgapacheiotdb-1234 -The `stagingRepositoryId` value must be an existing Nexus staging repository id -created by the first deploy. Do not use a made-up id. - -Supported classifiers are selected by the active OS profile: +Supported classifiers are: - `linux-x86_64` - `linux-aarch64` diff --git a/iotdb-tools-thrift/README_zh.md b/iotdb-tools-thrift/README_zh.md index 23c1793..e7d9912 100644 --- a/iotdb-tools-thrift/README_zh.md +++ b/iotdb-tools-thrift/README_zh.md @@ -49,7 +49,62 @@ Windows 上请使用 `mvnw.cmd` 替代 `./mvnw`。 构建产物会生成到 `target/` 目录下。请确认压缩包中包含 `bin/thrift`,并确认该 二进制文件输出的 Apache Thrift 版本符合预期。 -## 发布到 Nexus +## 使用 GitHub Actions 构建发布 artifacts + +`Build IoTDB Tools Thrift Artifacts` workflow 会构建六个平台的 zip artifacts, +但不会签名,也不会 deploy 到 Nexus。请在 GitHub Actions 页面手动触发该 +workflow,可以通过 `git_ref` 输入指定要构建的分支、tag 或 commit SHA。 + +workflow 会上传一个名为 `iotdb-tools-thrift-all-platforms` 的汇总 artifact。 +下载并解压到当前模块的以下目录: + + iotdb-tools-thrift/prebuilt-artifacts/ + +如果使用 GitHub CLI,可以执行: + + gh run download --name iotdb-tools-thrift-all-platforms --dir prebuilt-artifacts + +该目录中必须包含以下文件: + +- `iotdb-tools-thrift-${project.version}-linux-x86_64.zip` +- `iotdb-tools-thrift-${project.version}-linux-aarch64.zip` +- `iotdb-tools-thrift-${project.version}-mac-x86_64.zip` +- `iotdb-tools-thrift-${project.version}-mac-aarch64.zip` +- `iotdb-tools-thrift-${project.version}-windows-x86_64.zip` +- `iotdb-tools-thrift-${project.version}-windows-aarch64.zip` + +`${project.version}` 是 Maven 项目版本,例如 `0.23.0.0`。 + +deploy 前请先检查这些压缩包。每个压缩包应当只包含 `bin/thrift` 可执行文件, +Windows 平台为 `bin/thrift.exe`,并且该可执行文件输出的 Apache Thrift 版本 +符合预期。 + +## 将预构建 artifacts 发布到 Nexus + +在当前目录本地执行 deploy。该命令会对 `prebuilt-artifacts/` 下的六个平台 +artifacts 签名并 deploy: + + ./mvnw clean deploy -P apache-release,prebuilt-artifacts + +如果下载目录不是默认的 `prebuilt-artifacts/`,可以通过 +`prebuilt.artifacts.dir` 指定: + + ./mvnw clean deploy -P apache-release,prebuilt-artifacts -Dprebuilt.artifacts.dir=/path/to/prebuilt-artifacts + +这一步会在 Nexus 中创建新的 staging repository。deploy 完成后,打开 +https://repository.apache.org/#stagingRepositories,检查上传的 artifacts。 + +如果需要重新 deploy 到已有 staging repository,请传入真实存在的 staging +repository id: + + ./mvnw clean deploy -P apache-release,prebuilt-artifacts -DstagingRepositoryId=orgapacheiotdb-1234 + +`stagingRepositoryId` 必须是 Nexus 里真实存在的 staging repository id,不能 +随便填写一个不存在的 id。 + +## 在每个平台本地构建并发布 + +如果不使用预构建 artifacts workflow,也可以继续按平台分别构建并 deploy。 先在一个平台上执行第一次 deploy,不要传入 `stagingRepositoryId`: @@ -63,10 +118,7 @@ repository id,例如 `orgapacheiotdb-1234`。 ./mvnw clean deploy -P apache-release -DstagingRepositoryId=orgapacheiotdb-1234 -`stagingRepositoryId` 必须是第一次 deploy 后 Nexus 里真实存在的 staging -repository id,不能随便填写一个不存在的 id。 - -支持的平台 classifier 由当前操作系统激活的 Maven profile 决定: +支持的平台 classifier 包括: - `linux-x86_64` - `linux-aarch64` diff --git a/iotdb-tools-thrift/pom.xml b/iotdb-tools-thrift/pom.xml index 55cd8cb..a4c6395 100644 --- a/iotdb-tools-thrift/pom.xml +++ b/iotdb-tools-thrift/pom.xml @@ -43,6 +43,7 @@ 0.23.0 Unix Makefiles Release + ${project.basedir}/prebuilt-artifacts @@ -153,6 +154,7 @@ maven-assembly-plugin + binary-assembly package single @@ -204,6 +206,11 @@ cmake-maven-plugin 3.29.3-b2 + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.0 + org.sonatype.plugins nexus-staging-maven-plugin @@ -446,5 +453,94 @@ Visual Studio 17 2022 + + + prebuilt-artifacts + + + + com.googlecode.maven-download-plugin + download-maven-plugin + + + get-thrift + none + + + + + com.googlecode.cmake-maven-project + cmake-maven-plugin + + + cmake-generate + none + + + cmake-compile + none + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + binary-assembly + none + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-prebuilt-artifacts + package + + attach-artifact + + + + + ${prebuilt.artifacts.dir}/${project.artifactId}-${project.version}-linux-x86_64.zip + zip + linux-x86_64 + + + ${prebuilt.artifacts.dir}/${project.artifactId}-${project.version}-linux-aarch64.zip + zip + linux-aarch64 + + + ${prebuilt.artifacts.dir}/${project.artifactId}-${project.version}-mac-x86_64.zip + zip + mac-x86_64 + + + ${prebuilt.artifacts.dir}/${project.artifactId}-${project.version}-mac-aarch64.zip + zip + mac-aarch64 + + + ${prebuilt.artifacts.dir}/${project.artifactId}-${project.version}-windows-x86_64.zip + zip + windows-x86_64 + + + ${prebuilt.artifacts.dir}/${project.artifactId}-${project.version}-windows-aarch64.zip + zip + windows-aarch64 + + + + + + + + + From 55e25eaa5ce66594582177d115686c114909a389 Mon Sep 17 00:00:00 2001 From: HTHou Date: Mon, 15 Jun 2026 11:10:29 +0800 Subject: [PATCH 5/8] Use older Ubuntu runners for thrift artifacts --- .github/workflows/iotdb-tools-thrift-artifacts.yml | 6 +++--- iotdb-tools-thrift/README.md | 2 ++ iotdb-tools-thrift/README_zh.md | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/iotdb-tools-thrift-artifacts.yml b/.github/workflows/iotdb-tools-thrift-artifacts.yml index 86f1099..7ec0c42 100644 --- a/.github/workflows/iotdb-tools-thrift-artifacts.yml +++ b/.github/workflows/iotdb-tools-thrift-artifacts.yml @@ -43,11 +43,11 @@ jobs: matrix: include: - classifier: linux-x86_64 - runner: ubuntu-24.04 + runner: ubuntu-22.04 platform: linux maven: ./mvnw - classifier: linux-aarch64 - runner: ubuntu-24.04-arm + runner: ubuntu-22.04-arm platform: linux maven: ./mvnw - classifier: mac-x86_64 @@ -160,7 +160,7 @@ jobs: bundle: name: Bundle all platform artifacts - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 needs: build steps: - name: Download platform artifacts diff --git a/iotdb-tools-thrift/README.md b/iotdb-tools-thrift/README.md index a8fa1fd..ce5397c 100644 --- a/iotdb-tools-thrift/README.md +++ b/iotdb-tools-thrift/README.md @@ -54,6 +54,8 @@ and that the binary reports the expected Apache Thrift version. The `Build IoTDB Tools Thrift Artifacts` workflow builds the six platform zip artifacts without signing or deploying them. Trigger it manually from GitHub Actions, optionally passing a branch, tag, or commit SHA in the `git_ref` input. +Linux artifacts are built on Ubuntu 22.04 runners to keep the generated +executables compatible with older glibc versions. The workflow uploads one bundled artifact named `iotdb-tools-thrift-all-platforms`. Download and extract that artifact into this diff --git a/iotdb-tools-thrift/README_zh.md b/iotdb-tools-thrift/README_zh.md index e7d9912..a1e4fc1 100644 --- a/iotdb-tools-thrift/README_zh.md +++ b/iotdb-tools-thrift/README_zh.md @@ -54,6 +54,8 @@ Windows 上请使用 `mvnw.cmd` 替代 `./mvnw`。 `Build IoTDB Tools Thrift Artifacts` workflow 会构建六个平台的 zip artifacts, 但不会签名,也不会 deploy 到 Nexus。请在 GitHub Actions 页面手动触发该 workflow,可以通过 `git_ref` 输入指定要构建的分支、tag 或 commit SHA。 +Linux artifacts 会固定使用 Ubuntu 22.04 runner 构建,以便生成的可执行文件 +兼容更老的 glibc 版本。 workflow 会上传一个名为 `iotdb-tools-thrift-all-platforms` 的汇总 artifact。 下载并解压到当前模块的以下目录: From 279c2b83bfde36134810f9805142383461595ed6 Mon Sep 17 00:00:00 2001 From: HTHou Date: Mon, 15 Jun 2026 11:28:59 +0800 Subject: [PATCH 6/8] Validate thrift artifacts on Ubuntu 24 runners --- .../iotdb-tools-thrift-artifacts.yml | 38 +++++++++++++++++-- iotdb-tools-thrift/README.md | 4 +- iotdb-tools-thrift/README_zh.md | 4 +- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/.github/workflows/iotdb-tools-thrift-artifacts.yml b/.github/workflows/iotdb-tools-thrift-artifacts.yml index 7ec0c42..616cad5 100644 --- a/.github/workflows/iotdb-tools-thrift-artifacts.yml +++ b/.github/workflows/iotdb-tools-thrift-artifacts.yml @@ -43,11 +43,11 @@ jobs: matrix: include: - classifier: linux-x86_64 - runner: ubuntu-22.04 + runner: ubuntu-24.04 platform: linux maven: ./mvnw - classifier: linux-aarch64 - runner: ubuntu-22.04-arm + runner: ubuntu-24.04-arm platform: linux maven: ./mvnw - classifier: mac-x86_64 @@ -149,6 +149,35 @@ jobs: throw "Expected archive to contain $expectedBinary" } + $extractDir = Join-Path $env:RUNNER_TEMP "thrift-$classifier" + Remove-Item -Recurse -Force $extractDir -ErrorAction SilentlyContinue + Expand-Archive -Path $zip.FullName -DestinationPath $extractDir + $binary = Join-Path $extractDir $expectedBinary + if (-not (Test-Path $binary)) { + throw "Expected binary not found after extraction: $expectedBinary" + } + if (-not $classifier.StartsWith("windows")) { + chmod +x $binary + } + + $version = & $binary --version + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + $version = ($version | Select-Object -Last 1).Trim() + Write-Host "Thrift version output: $version" + if ($version -ne "Thrift version 0.23.0") { + throw "Unexpected thrift version output: $version" + } + + if ($classifier.StartsWith("linux")) { + $fileInfo = & file $binary + Write-Host "file output: $fileInfo" + if ($fileInfo -notmatch "statically linked") { + throw "Expected Linux thrift binary to be statically linked" + } + } + - name: Upload platform artifact uses: actions/upload-artifact@v4 with: @@ -160,7 +189,7 @@ jobs: bundle: name: Bundle all platform artifacts - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 needs: build steps: - name: Download platform artifacts @@ -176,6 +205,9 @@ jobs: set -euo pipefail ls -lah dist test "$(find dist -maxdepth 1 -name '*.zip' | wc -l)" -eq 6 + for classifier in linux-x86_64 linux-aarch64 mac-x86_64 mac-aarch64 windows-x86_64 windows-aarch64; do + test "$(find dist -maxdepth 1 -name "*-${classifier}.zip" | wc -l)" -eq 1 + done - name: Upload bundled artifact uses: actions/upload-artifact@v4 diff --git a/iotdb-tools-thrift/README.md b/iotdb-tools-thrift/README.md index ce5397c..ceabccc 100644 --- a/iotdb-tools-thrift/README.md +++ b/iotdb-tools-thrift/README.md @@ -54,8 +54,8 @@ and that the binary reports the expected Apache Thrift version. The `Build IoTDB Tools Thrift Artifacts` workflow builds the six platform zip artifacts without signing or deploying them. Trigger it manually from GitHub Actions, optionally passing a branch, tag, or commit SHA in the `git_ref` input. -Linux artifacts are built on Ubuntu 22.04 runners to keep the generated -executables compatible with older glibc versions. +The workflow verifies that each generated compiler reports the expected Apache +Thrift version, and that Linux compilers are statically linked. The workflow uploads one bundled artifact named `iotdb-tools-thrift-all-platforms`. Download and extract that artifact into this diff --git a/iotdb-tools-thrift/README_zh.md b/iotdb-tools-thrift/README_zh.md index a1e4fc1..5281291 100644 --- a/iotdb-tools-thrift/README_zh.md +++ b/iotdb-tools-thrift/README_zh.md @@ -54,8 +54,8 @@ Windows 上请使用 `mvnw.cmd` 替代 `./mvnw`。 `Build IoTDB Tools Thrift Artifacts` workflow 会构建六个平台的 zip artifacts, 但不会签名,也不会 deploy 到 Nexus。请在 GitHub Actions 页面手动触发该 workflow,可以通过 `git_ref` 输入指定要构建的分支、tag 或 commit SHA。 -Linux artifacts 会固定使用 Ubuntu 22.04 runner 构建,以便生成的可执行文件 -兼容更老的 glibc 版本。 +workflow 会验证每个平台生成的 compiler 是否输出预期的 Apache Thrift 版本, +并确认 Linux compiler 是静态链接的。 workflow 会上传一个名为 `iotdb-tools-thrift-all-platforms` 的汇总 artifact。 下载并解压到当前模块的以下目录: From 0c3a2c064167825137f7e7bb3600cceaf9919f27 Mon Sep 17 00:00:00 2001 From: HTHou Date: Mon, 15 Jun 2026 11:30:02 +0800 Subject: [PATCH 7/8] Run thrift artifact workflow on pull requests --- .github/workflows/iotdb-tools-thrift-artifacts.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/iotdb-tools-thrift-artifacts.yml b/.github/workflows/iotdb-tools-thrift-artifacts.yml index 616cad5..2b1a857 100644 --- a/.github/workflows/iotdb-tools-thrift-artifacts.yml +++ b/.github/workflows/iotdb-tools-thrift-artifacts.yml @@ -26,6 +26,10 @@ on: description: Optional branch, tag, or commit SHA to build required: false type: string + pull_request: + paths: + - .github/workflows/iotdb-tools-thrift-artifacts.yml + - iotdb-tools-thrift/** permissions: contents: read @@ -71,7 +75,7 @@ jobs: - name: Check out source uses: actions/checkout@v4 with: - ref: ${{ inputs.git_ref || github.ref }} + ref: ${{ github.event_name == 'workflow_dispatch' && inputs.git_ref || github.ref }} - name: Set up Java uses: actions/setup-java@v4 From 66652639512f264edd9c2fe110957d42ce48f392 Mon Sep 17 00:00:00 2001 From: HTHou Date: Mon, 15 Jun 2026 11:40:16 +0800 Subject: [PATCH 8/8] Fix Windows thrift artifact validation --- .github/workflows/iotdb-tools-thrift-artifacts.yml | 4 ++-- iotdb-tools-thrift/README.md | 4 ++-- iotdb-tools-thrift/README_zh.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/iotdb-tools-thrift-artifacts.yml b/.github/workflows/iotdb-tools-thrift-artifacts.yml index 2b1a857..a283455 100644 --- a/.github/workflows/iotdb-tools-thrift-artifacts.yml +++ b/.github/workflows/iotdb-tools-thrift-artifacts.yml @@ -81,7 +81,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: 17 + java-version: 21 cache: maven - name: Install Linux build prerequisites @@ -142,7 +142,7 @@ jobs: $archive.Dispose() } - $expectedBinary = if ($classifier.StartsWith("windows")) { "bin/thrift.exe" } else { "bin/thrift" } + $expectedBinary = if ($classifier.StartsWith("windows")) { "bin/Release/thrift.exe" } else { "bin/thrift" } Write-Host "Archive: $($zip.Name)" $files | ForEach-Object { Write-Host " - $_" } diff --git a/iotdb-tools-thrift/README.md b/iotdb-tools-thrift/README.md index ceabccc..00bf7f0 100644 --- a/iotdb-tools-thrift/README.md +++ b/iotdb-tools-thrift/README.md @@ -79,8 +79,8 @@ The directory must contain these files: `${project.version}` is the Maven project version, for example `0.23.0.0`. Verify the archives before deploying them. Each archive should contain only the -`bin/thrift` executable, or `bin/thrift.exe` on Windows, and the executable -should report the expected Apache Thrift version. +`bin/thrift` executable, or `bin/Release/thrift.exe` on Windows, and the +executable should report the expected Apache Thrift version. ## Deploy Prebuilt Artifacts to Nexus diff --git a/iotdb-tools-thrift/README_zh.md b/iotdb-tools-thrift/README_zh.md index 5281291..3bdf09d 100644 --- a/iotdb-tools-thrift/README_zh.md +++ b/iotdb-tools-thrift/README_zh.md @@ -78,8 +78,8 @@ workflow 会上传一个名为 `iotdb-tools-thrift-all-platforms` 的汇总 arti `${project.version}` 是 Maven 项目版本,例如 `0.23.0.0`。 deploy 前请先检查这些压缩包。每个压缩包应当只包含 `bin/thrift` 可执行文件, -Windows 平台为 `bin/thrift.exe`,并且该可执行文件输出的 Apache Thrift 版本 -符合预期。 +Windows 平台为 `bin/Release/thrift.exe`,并且该可执行文件输出的 Apache +Thrift 版本符合预期。 ## 将预构建 artifacts 发布到 Nexus