发布管理指南¶
本页面提供了执行发布所遵循步骤的详细信息。它既可以用作学习 ADBC 发布流程的指南,也可以作为发布经理在执行发布时的综合检查清单。
另请参阅
原则¶
Apache Arrow 发布遵循 Apache 软件基金会发布政策中定义的准则。
发布准备¶
发布的一些步骤需要是提交者或 PMC 成员。
Apache 信任网络中的 GPG 密钥用于签署工件。该密钥必须由其他 Apache 提交者/PMC 成员交叉签名。您必须在
dev/release/.env中设置您的 GPG 密钥 ID(参见dev/release/.env.example以获取模板)。配置 Maven 以将制品发布到 Apache 仓库。你需要按照 Apache 指南 的说明,在
~/.m2/settings-security.xml和settings.xml中设置主密码。可以通过以下命令进行测试# You might need to export GPG_TTY=$(tty) to properly prompt for a passphrase mvn clean install -Papache-release
一个 Artifactory API 密钥(使用您的 ASF 凭据登录,然后从右上角的个人资料中生成)。您必须在
dev/release/.env中设置 Artifactory API 密钥(参见dev/release/.env.example以获取模板)。安装
en_US.UTF-8区域设置(locale)。你可以通过locale -a确认可用的区域设置。安装带有 conda-forge 的 Conda,并创建并激活环境。
mamba create -n adbc -c conda-forge --file ci/conda_env_dev.txt
这将安装发布过程中使用的两个工具:
commitizen(根据提交信息生成变更日志)和gh(提交作业/下载制品)。安装 Docker。
克隆主 Arrow 仓库(https://github.com/apache/arrow)并将
arrow-adbc/dev/release/.env软链接到arrow/dev/release/.env。一些发布脚本依赖于主 Arrow 仓库中的脚本。
创建发布候选版本(RC)之前¶
重新生成 LICENSE.txt(参见 CONTRIBUTING.md),如果需要进行任何更改,请创建一个拉取请求(PR)。
设置你的 Shell 环境
# Setup gpg agent for signing artifacts source dev/release/setup-gpg-agent.sh # Activate conda environment mamba activate adbc
确保合并的拉取请求和已关闭的问题已正确设置里程碑(milestone)
./dev/release/assign-milestone.sh
检查每日验证作业¶
确保 验证作业 通过。这模拟了部分发布验证工作流,以便提前发现问题。
创建发布候选版本¶
这些是创建发布候选版本所需的各个步骤。
对于初始发布候选版本,我们将从主分支(master)创建一个维护分支。后续的发布候选版本将通过拣选(cherry-pick)特定提交来更新维护分支。
我们在发布候选版本之间实施了功能冻结(Feature Freeze)政策。这意味着,通常情况下,我们只应在发布候选版本之间添加错误修复。在极少数情况下,如果社区达成共识,可以在发布候选版本之间添加关键功能。
创建或更新相应的维护分支¶
# Execute the following from an up to date master branch.
# This will create a branch locally called maint-X.Y.Z.
# X.Y.Z corresponds with the Major, Minor and Patch version number
# of the release respectively. As an example 9.0.0
git branch maint-X.Y.Z
# Push the maintenance branch to the remote repository
git push -u apache maint-X.Y.Z
git switch maint-X.Y.Z
# Remove the commits that created the changelog and bumped the
# versions, since 01-prepare.sh will redo those steps
git reset --hard HEAD~2
# Cherry-pick any commits by hand.
git cherry-pick ...
# Push the updated maintenance branch to the remote repository
git push -u apache maint-X.Y.Z
从更新后的维护分支创建发布候选版本标签¶
# Start from the updated maintenance branch.
git switch maint-X.Y.Z
# The following script will create a branch for the Release Candidate,
# place the necessary commits updating the version number and changelog, and then create a git tag
# on OSX use gnu-sed with homebrew: brew install gnu-sed (and export to $PATH)
#
# <rc-number> starts at 0 and increments every time the Release Candidate is burned
# so for the first RC this would be: dev/release/01-prepare.sh 1.0.0 0
dev/release/01-prepare.sh <arrow-dir> <rc-number>
git push -u apache apache-arrow-adbc-<release>-rc<rc-number> maint-<release>
构建源代码和二进制文件并提交它们¶
# Download the produced source and binaries, sign them, and add the
# signatures to the GitHub release
#
# On macOS the only way I could get this to work was running "echo
# "UPDATESTARTUPTTY" | gpg-connect-agent" before running this
# comment otherwise I got errors referencing "ioctl" errors.
dev/release/02-sign.sh <rc-number>
# Upload the source release tarball and signs to
# https://dist.apache.org/repos/dist/dev/arrow .
dev/release/03-source.sh <rc-number>
# Upload the Java artifacts
#
# Note that you need to press the "Close" button manually in the Web
# interface after you complete the script:
# https://repository.apache.org/#stagingRepositories
dev/release/04-java-upload.sh <rc-number>
# Sign and upload the deb/rpm packages and APT/Yum repositories
#
# This reuses release scripts in apache/arrow. So you need to
# specify cloned apache/arrow directory.
dev/release/05-linux-upload.sh <arrow-dir> <rc-number>
# Start verifications for binaries and wheels
dev/release/06-binary-verify.sh <rc-number>
验证发布¶
使用 06-binary-verify.sh 中的电子邮件模板,在 dev@arrow.apache.org 上启动投票帖。
投票与批准¶
在 dev@arrow.apache.org 上启动投票帖,并提供验证发布完整性的说明。批准需要来自 PMC 成员的净 3 张 +1 票。发布不能被否决。
如何验证发布候选版本¶
安装依赖项。至少需要:
cURL
Docker(用于验证二进制文件)
Git
GnuPG
shasum(内置于 macOS)或 sha256sum/sha512sum(在 Linux 上)
你还需要安装构建和验证所有语言所需的所有依赖项。大致来说,这意味着:
C 和 C++ 编译器(或你平台上相当于
build-essential的工具)Python 3
- 带有头文件的 Ruby
需要 meson
bundler、rake、red-arrow 和 test-unit Ruby gems
- 带有头文件的 GLib 和 gobject-introspection
pkg-config 或 cmake 必须能够找到 libarrow-glib.so
GI_TYPELIB_PATH 应设置为 girepository-1.0 目录的路径
- Java JRE 和 JDK (Java 11+)
javadoc 命令也必须可访问
Go
CMake, ninja-build, libpq(带头文件), SQLite(带头文件)
Node.js 22+
或者,你可以让验证脚本通过 Conda 自动下载并安装依赖项。请参阅下面的环境变量。
克隆项目
$ git clone https://github.com/apache/arrow-adbc.git
运行验证脚本
$ cd arrow-adbc # Pass the release and the RC number $ ./dev/release/verify-release-candidate.sh 0.1.0 6
这些环境变量可能会有所帮助
ARROW_TMPDIR=/path/to/directory用于指定使用的临时目录。使用固定目录有助于避免在脚本必须多次运行时重复相同的设置和构建步骤。USE_CONDA=1以下载并设置 Conda 来管理依赖项。在这种情况下,系统所需的依赖项较少。(但仍需要 Git, GnuPG, cURL 等。)
一旦完成且脚本通过,请在邮件列表的投票帖中回复 +1 或 -1。
发布后任务¶
发布投票通过后,我们必须执行多项任务来更新源代码制品、二进制构建和 Arrow 网站。
请确保逐一核对以下清单:
关闭 GitHub 里程碑/项目...
打开 https://github.com/orgs/apache/projects 并找到该项目
点击项目的“…”
选择“关闭(Close)”
点击“关闭(Close)”
将新版本添加到 Apache 报告系统...
将相关的 Arrow 发布数据添加到 Apache 报告系统。
将源码发布制品上传到 Subversion...
PMC 成员必须将源码发布制品提交到 Subversion
# dev/release/post-01-upload.sh 0
dev/release/post-01-upload.sh <rc-number>
git push apache apache-arrow-adbc-<release>
创建最终的 GitHub 发布...
提交者(Committer)必须创建最终的 GitHub 发布
# dev/release/post-02-binary.sh 0
dev/release/post-02-binary.sh <rc-number>
更新网站...
这在推送标签时会自动完成。请检查 nightly-website.yml 工作流是否成功。
将 wheels/sdist 上传到 PyPI...
我们使用 twine 工具将 wheels 上传到 PyPI
dev/release/post-03-python.sh
发布 Maven 包...
登录 Apache 仓库:https://repository.apache.org/#stagingRepositories
选择你为 RC 创建的 Arrow 暂存仓库:
orgapachearrow-XXXX点击
release按钮
更新 Go 模块标签...
# dev/release/post-04-go.sh
dev/release/post-04-go.sh
部署 APT/Yum 仓库...
# This reuses release scripts in apache/arrow. So you need to
# specify cloned apache/arrow directory.
#
# dev/release/post-05-linux.sh ../arrow 0
dev/release/post-05-linux.sh <arrow-dir> <rc-number>
更新 R 包...
这是一个手动过程。请参阅 Arrow R 包 的处理流程。
上传 Ruby 包到 RubyGems...
你必须是 https://rubygems.org.cn/gems/red-adbc 的所有者之一。如果你还不是 red-adbc 的所有者,现有的所有者必须运行以下命令行将你添加到 red-adbc 的所有者中
gem owner -a ${RUBYGEMS_ORG_ACCOUNT_FOR_RELEASE_MANAGER} red-adbc
red-adbc 的所有者可以进行上传
# dev/release/post-06-ruby.sh
dev/release/post-06-ruby.sh
上传 C#/.NET 包到 NuGet...
你必须是该包的所有者之一。如果你还不是所有者,现有的所有者可以在 https://nuget.net.cn 上添加你。
你需要 创建 API 密钥 <https://learn.microsoft.com/en-us/nuget/nuget-org/publish-a-package#create-an-api-key>。
所有者可以进行上传
export NUGET_API_KEY=<your API key here>
# dev/release/post-07-csharp.sh
dev/release/post-07-csharp.sh
上传 Rust crates 到 crates.io...
你必须是该包的所有者之一。如果你还不是所有者,现有的所有者可以在 https://crates.io 上添加你。
你需要 创建 API 令牌 <https://crates.io/settings/tokens>。
所有者可以进行上传
cargo login
# dev/release/post-08-rust.sh
dev/release/post-08-rust.sh
上传 Node.js 包到 npm...
你必须拥有 apache-arrow npm 组织 的发布权限。如果你还没有权限,现有的组织管理员可以添加你。
你需要 创建访问令牌。
所有者可以进行上传
export NPM_TOKEN=<your access token here>
# dev/release/post-09-npm.sh
dev/release/post-09-npm.sh
更新 conda-forge 包...
提交一个将版本升级到 feedstock 的 PR:https://github.com/conda-forge/arrow-adbc-split-feedstock
conda-forge 或 feedstock 维护者可以审查并合并。
更新 Homebrew 公式...
提交单独的 PR 以更新每个公式以进行新发布
apache-arrow-adbc
apache-arrow-adbc-glib
参见 https://docs.brew.sh.cn/Formula-Cookbook#updating-formulae。
删除旧制品...
删除 https://dist.apache.org/repos/dist/dev/arrow/ 上的 RC 制品以及 https://dist.apache.org/repos/dist/release/arrow 上的旧发布制品,以遵循 ASF 政策
dev/release/post-10-remove-old-artifacts.sh
提升版本号...
首先,更新 dev/release/versions.env 中的版本号。然后,运行此脚本将这些版本号应用到文件和文件名中嵌入的版本中。脚本还将把变更日志更新为新发布的变更日志。
# dev/release/post-12-bump-versions.sh ../arrow
dev/release/post-12-bump-versions.sh <arrow-dir>
发布版本博客文章...
运行脚本生成博客文章大纲,然后填写大纲并在 apache/arrow-site 上创建一个 PR。
# dev/release/post-13-website.sh ../arrow-site
dev/release/post-13-website.sh <arrow-site-dir>
宣布新版本...
撰写发布公告并发送至 announce@apache.org 和 dev@arrow.apache.org。下面的脚本将生成公告。它要求你提供上述博客文章的 URL,因此在博客文章发布之前无法发送。此外,它期望从 发布分支 而不是 main 运行。
发送给 announce@apache.org 的公告必须从你的 apache.org 电子邮件地址发送才能被接收。
模板
dev/release/post-11-announce.sh