发布管理指南

本页提供执行发布所遵循步骤的详细信息。它既可以作为学习 ADBC 发布流程的指南,也可以作为发布经理执行发布时的全面清单。

原则

Apache Arrow 发布遵循 Apache 软件基金会发布政策中定义的准则。

准备发布

发布的一些步骤需要是提交者或 PMC 成员。

  • Apache 信任网络中的 GPG 密钥用于签署工件。该密钥必须由其他 Apache 提交者/PMC 成员交叉签名。您必须在 dev/release/.env 中设置您的 GPG 密钥 ID(参见 dev/release/.env.example 以获取模板)。

  • GPG 密钥需要添加到此 SVN 仓库此仓库

  • 配置 Maven 以 将工件发布到 Apache 仓库。您需要在 ~/.m2/settings-security.xmlsettings.xml设置主密码,如 Apache 指南 所述。它可以通过以下命令进行测试

    # 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 -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 仓库中的脚本。

创建发布候选版本之前

重新生成 LICENSE.txt(参见 CONTRIBUTING.md),如果需要任何更改,请创建拉取请求。

# Setup gpg agent for signing artifacts
source dev/release/setup-gpg-agent.sh

# Activate conda environment
mamba activate adbc

检查夜间验证作业

确保 验证作业 通过。这模拟了发布验证工作流的一部分,以便提前检测问题。

创建发布候选版本

这些是创建发布候选版本所需的不同步骤。

对于最初的发布候选版本,我们将从 master 分支创建一个维护分支。后续的发布候选版本将通过 cherry-pick 特定提交来更新维护分支。

我们已在发布候选版本之间实施了功能冻结策略。这意味着,通常情况下,我们只应在发布候选版本之间添加错误修复。在极少数情况下,如果社区达成共识,可以在发布候选版本之间添加关键功能。

创建或更新相应的维护分支

# 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 票净值。发布不能被否决。

如何验证发布候选版本

  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(带头文件)

    或者,您可以让验证脚本通过 Conda 自动下载并安装依赖项。请参阅下面的环境变量。

  2. 克隆项目

    $ git clone https://github.com/apache/arrow-adbc.git
    
  3. 运行验证脚本

    $ 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 和其他一些仍然需要。)

  4. 完成后,一旦脚本通过,请回复邮件列表投票线程,并附上 +1 或 -1。

发布后任务

发布投票后,我们必须承担许多任务来更新源工件、二进制构建和 Arrow 网站。

请务必仔细检查以下清单

关闭 GitHub 里程碑/项目
将新版本添加到 Apache Reporter 系统

将 Arrow 的相关发布数据添加到 Apache reporter

将源发布工件上传到 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 发布

提交者必须创建最终的 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 包
更新 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 crate 上传到 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
更新 conda-forge 包

提交一个 PR,将版本升级到 feedstock:https://github.com/conda-forge/arrow-adbc-split-feedstock

conda-forge 或 feedstock 维护者可以审查并合并。

宣布新版本

撰写发布公告并发送到 announce@apache.orgdev@arrow.apache.org

发送到 announce@apache.org 的公告必须从您的 apache.org 电子邮件地址发送才能被接受。

模板

dev/release/post-09-announce.sh
移除旧工件

删除 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-11-bump-versions.sh ../arrow
dev/release/post-11-bump-versions.sh <arrow-dir>
发布发布博客文章

运行脚本生成博客文章大纲,然后填写大纲并在 apache/arrow-site 上创建 PR。

# dev/release/post-12-website.sh ../arrow-site
dev/release/post-12-website.sh <arrow-site-dir>