发布管理指南

此页面提供了有关执行发布所遵循步骤的详细信息。 它可以既用作学习 ADBC 发布过程的指南,也可用作发布经理在执行发布时的全面清单。

原则

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

准备发布

发布的某些步骤需要作为提交者或 PMC 成员。

  • Apache Web of Trust 中的 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-picking 特定提交来更新维护分支。

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

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

# 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 gem

    • 带有标头的 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 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
更新 conda-forge 包

提交一个 PR,将版本 bump 到 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
移除旧的 artifacts

删除 https://dist.apache.org/repos/dist/dev/arrow/ 上的 RC artifacts 和 https://dist.apache.org/repos/dist/release/arrow 上的旧版本 artifacts,以遵循 ASF 政策

dev/release/post-10-remove-old-artifacts.sh
Bump 版本号

首先,更新 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>