本模块用于发布 IoTDB 构建过程中使用的、按平台区分的 Apache Thrift compiler 压缩包。压缩包中只包含 thrift 可执行文件。
构建本模块前需要安装以下软件:
settings.xml 中配置好 server id 为 apache.releases.https 的 Apache Nexus 凭据Linux profile 会用 -static 链接 thrift 可执行文件,因此构建机器需要具备 当前 C/C++ 工具链静态链接所需的运行时库。
Windows 上请使用 mvnw.cmd 替代 ./mvnw。
在当前目录执行:
./mvnw clean package -DskipTests
构建产物会生成到 target/ 目录下。请确认压缩包中包含 bin/thrift,并确认该 二进制文件输出的 Apache Thrift 版本符合预期。
Build IoTDB Tools Thrift Artifacts workflow 会构建六个平台的 zip artifacts, 但不会签名,也不会 deploy 到 Nexus。请在 GitHub Actions 页面手动触发该 workflow,可以通过 git_ref 输入指定要构建的分支、tag 或 commit SHA。 workflow 会验证每个平台生成的 compiler 是否输出预期的 Apache Thrift 版本, 并确认 Linux compiler 是静态链接的。
workflow 会上传一个名为 iotdb-tools-thrift-all-platforms 的汇总 artifact。 下载并解压到当前模块 target/ 下的以下目录:
iotdb-tools-thrift/target/prebuilt-artifacts/
如果使用 GitHub CLI,可以执行:
gh run download <run-id> --name iotdb-tools-thrift-all-platforms --dir target/prebuilt-artifacts
该目录中必须包含以下文件:
iotdb-tools-thrift-${project.version}-linux-x86_64.zipiotdb-tools-thrift-${project.version}-linux-aarch64.zipiotdb-tools-thrift-${project.version}-mac-x86_64.zipiotdb-tools-thrift-${project.version}-mac-aarch64.zipiotdb-tools-thrift-${project.version}-windows-x86_64.zipiotdb-tools-thrift-${project.version}-windows-aarch64.zip${project.version} 是 Maven 项目版本,例如 0.23.0.0。
deploy 前请先检查这些压缩包。每个压缩包应当只包含 bin/thrift 可执行文件, Windows 平台为 bin/Release/thrift.exe,并且该可执行文件输出的 Apache Thrift 版本符合预期。
下载 artifacts 后,在当前目录本地执行 deploy。该命令会对 target/prebuilt-artifacts/ 下的六个平台 artifacts 签名并 deploy:
./mvnw deploy -P apache-release,prebuilt-artifacts
如果需要 clean build,请先执行 ./mvnw clean,再下载预构建 artifacts,因为 clean 会删除 target/。
如果下载目录不是默认的 target/prebuilt-artifacts/,可以通过 prebuilt.artifacts.dir 指定:
./mvnw 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 deploy -P apache-release,prebuilt-artifacts -DstagingRepositoryId=orgapacheiotdb-1234
stagingRepositoryId 必须是 Nexus 里真实存在的 staging repository id,不能 随便填写一个不存在的 id。
如果不使用预构建 artifacts workflow,也可以继续按平台分别构建并 deploy。
先在一个平台上执行第一次 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
支持的平台 classifier 包括:
linux-x86_64linux-aarch64mac-x86_64mac-aarch64windows-x86_64windows-aarch64所有平台压缩包都 deploy 完成后,在 Nexus 中检查 staging repository,确认无误后 close,然后继续 Apache release vote 和 release 流程。