發佈管理指南#

此頁面提供關於執行發佈的詳細步驟資訊。它可以用作學習 Apache Arrow 發佈流程的指南,以及發佈管理員在執行發佈時的完整檢查清單。擔任發佈管理員的人員必須至少具有提交者身分才能執行以下任務。如果發佈管理員是提交者但不是 PMC 成員,則某些任務需要委派給 PMC 成員,這些任務在下方會相應標記。

原則#

Apache Arrow 發佈遵循 Apache 軟體基金會發佈政策 中定義的準則。

準備發佈#

在建立來源發佈之前,發佈管理員必須確保任何已解決的 GitHub issue 都已設定適當的里程碑,以便正確產生變更日誌。

請注意,沒有對應 GitHub issue 的 pull request 不會被 cherry-pick 腳本偵測到,必須由發佈管理員手動 cherry-pick 到維護分支。範例包括 MINOR 和 Dependabot pull request。因此,建議為在發佈維護分支建立後合併到預設分支的任何 pull request 建立 issue,以避免需要手動 cherry-pick。

需求

發佈的某些步驟需要成為提交者或 PMC 成員。

  • 安裝 Archery 工具,這是發佈所需的。

  • 除非您想使用預設 GCC 以外的其他工具(例如 clang)進行建置,否則您不得定義任何 arrow-cpp 或 parquet-cpp 環境變數,CC 或 CXX 除外。

  • Apache Web of Trust 中的 GPG 金鑰,用於簽署工件。這將需要由其他 Apache 提交者/PMC 成員交叉簽署。如果您有多個 GPG 金鑰,您必須在 ~/.gnupg/gpg.conf 中設定正確的 GPG 金鑰 ID,方法是新增

default-key ${YOUR_GPG_KEY_ID}
  • GPG 金鑰需要新增到此 SVN 儲存庫這個儲存庫

  • 安裝 cpp 和 c_glib 的建置需求。

  • 設定 CROSSBOW_GITHUB_TOKEN 環境變數以自動建立驗證發佈 Pull Request。

  • 安裝 en_US.UTF-8 locale。您可以使用 locale -a 確認可用的 locale。

  • 安裝 Python 3 作為 python

  • 從 dev/release/.env.example 建立 dev/release/.env。請參閱 dev/release/.env.example 中的註解,了解如何設定每個變數。

  • 依照定義設定 Crossbow

  • 安裝 Docker 和 Docker Compose。

在建立發佈候選版本之前#

確保移除本機標籤、設定 gpg-agent,且正確指派 GitHub issue。

# Delete the local tag for RC1 or later
git tag -d apache-arrow-<version>

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

# Curate the release
# The end of the generated report shows any GitHub issues with the wrong
# version number assigned.
archery release curate <version>

確保在 GitHub 上為後續發佈建立主要版本里程碑。我們的合併腳本將自動使用此里程碑作為在建立維護分支時關閉的 issue 的新版本。

修補程式發佈#

我們通常在識別出主要破壞性問題後建立修補程式發佈。被識別為主要破壞性問題的問題可能是安全性修復、特定建置的套件損壞以及其他問題。

任何開發人員都可以要求產生修補程式發佈,方法是發送電子郵件到 Arrow 開發郵件列表,說明為何需要新發佈的原因。如果達成共識並且有發佈管理員願意付出努力建立發佈,則可以建立修補程式發佈。

提交者可以使用 backport-candidate 標籤標記應包含在下一個修補程式發佈中的 issue。作者或提交者有責任將標籤新增到 issue,以協助發佈管理員識別應回溯移植的 issue。

如果特定 issue 被識別為建立修補程式發佈的原因,則發佈管理員應驗證至少此 issue 已正確標記並包含在修補程式發佈中。

請務必完成以下檢查清單

  1. 建立里程碑

  2. 建立維護分支

  3. 包含要求作為新修補程式發佈的問題

  4. 將新里程碑新增到具有 backport-candidate 標籤的 issue

  5. 將 issue cherry-pick 到維護分支

建立發佈候選版本#

以下是建立發佈候選版本所需的不同步驟。

對於主要發佈的初始發佈候選版本,我們將從 main 建立維護分支。

後續發佈候選版本將透過 cherry-pick 特定 commit 來更新維護分支。

對於次要或修補程式發佈的初始發佈候選版本,我們將從先前的對應發佈建立維護分支。例如,對於 15.0.1 修補程式,我們將從 maint-15.0.0 建立 maint-15.0.1 分支,對於 maint-15.0.2,我們將從 maint-15.0.1 建立。建立維護分支後,我們將透過 cherry-pick 特定 commit 來更新建立的維護分支。

我們已實施發佈候選版本之間的「功能凍結」政策。這表示一般而言,我們應該只在發佈候選版本之間新增錯誤修復。在極少數情況下,如果社群達成共識,則可以在發佈候選版本之間新增關鍵功能。

建立或更新對應的維護分支#

# Execute the following from an up to date main 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
archery release cherry-pick X.Y.Z --execute
# Push the maintenance branch to the remote repository
git push -u apache maint-X.Y.Z
# First run in dry-mode to see which commits will be cherry-picked.
# If there are commits that we don't want to get applied, ensure the
# milestone on GitHub is set to the following release.
archery release cherry-pick X.Y.Z --continue
# Update the maintenance branch with the previous commits
archery release cherry-pick X.Y.Z --continue --execute
# Push the updated maintenance branch to the remote repository
git push -u apache maint-X.Y.Z

選用:在建立發佈候選版本之前進行測試#

一些發佈管理員傾向在建立第一個發佈候選版本之前執行測試,以避免在給定發佈中需要建立多個發佈候選版本。

在建立發佈候選版本之前進行測試

  • 從最新的 maint-X.Y.Z 分支建立 pull request 到 main

  • 將 pull request 標題設為「WIP: Dummy PR to check maint-X.Y.Z status」

  • 在 pull request 上評論以觸發相關的 Crossbow job

    • @github-actions crossbow submit --group verify-rc-source

    • @github-actions crossbow submit --group packaging

從更新的維護分支建立發佈候選版本分支#

# Start from the updated maintenance branch.
git checkout maint-X.Y.Z

# The following script will create a branch for the Release Candidate,
# place the necessary commits updating the version number 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 created
# so for the first RC this would be: dev/release/01-prepare.sh 4.0.0 5.0.0 0
dev/release/01-prepare.sh <version> <next-version> <rc-number>

# Push the release candidate tag
git push -u apache apache-arrow-<version>-rc<rc-number>
# Push the release candidate branch in order to trigger verification jobs later
git push -u apache release-<version>-rc<rc-number>

建置來源和二進位檔並提交它們#

# Build the source release tarball and create Pull Request with verification tasks
#
# NOTE: This must be run by a PMC member
# NOTE: You need to have GitHub CLI installed to run this script.
dev/release/02-source.sh <version> <rc-number>

# Submit binary tasks using crossbow, the command will output the crossbow build id
dev/release/03-binary-submit.sh <version> <rc-number>

# Wait for the crossbow jobs to finish
archery crossbow status <crossbow-build-id>

# Download the produced binaries
# This will download packages to a directory called packages/release-<version>-rc<rc-number>
dev/release/04-binary-download.sh <version> <rc-number>

# Sign and upload the binaries
#
# NOTE: This must be run by a PMC member
#
# 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/05-binary-upload.sh <version> <rc-number>

# Sign and upload MATLAB artifacts to the GitHub Releases area.
#
# NOTE: This must be run by a PMC member
# NOTE: You need to have GitHub CLI installed to run this script.
dev/release/06-matlab-upload.sh <version> <rc-number>

# Start verifications for binaries and wheels
dev/release/07-binary-verify.sh <version> <rc-number>

驗證發佈#

# Once the automatic verification has passed start the vote thread
# on dev@arrow.apache.org. To regenerate the email template use
SOURCE_DEFAULT=0 SOURCE_VOTE=1 dev/release/02-source.sh <version> <rc-number>

有關詳細資訊,請參閱 發佈驗證流程

投票與批准#

dev@arrow.apache.org 上啟動投票討論串,並提供驗證發佈完整性的說明。批准需要 PMC 成員的淨額 3 個 +1 票。發佈不能被否決。

發佈後任務#

在發佈投票後,我們必須執行許多任務來更新來源工件、二進位建置和 Arrow 網站。

請務必完成以下檢查清單

  1. 更新已發佈里程碑的日期,並在 GitHub 上設定為「已關閉」

  2. 合併發佈分支上的變更到修補程式發佈的維護分支

  3. 將新發佈新增到 Apache Reporter System

  4. 推送發佈標籤

  5. 上傳來源

  6. 上傳二進位檔

  7. 更新網站

  8. 更新 GitHub 發佈說明

  9. 更新 Homebrew 套件

  10. 更新 MSYS2 套件

  11. 上傳 RubyGems

  12. 上傳 JavaScript 套件

  13. 上傳 C# 套件

  14. 更新 conda 食譜

  15. 上傳 wheels/sdist 到 pypi

  16. 更新 R 套件

  17. 更新 vcpkg port

  18. 更新 Conan 食譜

  19. Bump 版本

  20. 更新文件

  21. 更新 Apache Arrow Cookbook 中的版本

  22. 公告新發佈

  23. 發佈發佈部落格文章

  24. 在 Twitter 上公告發佈

  25. 移除舊工件

合併發佈分支上的變更到修補程式發佈的維護分支

合併 release-X.Y.Z-rcNmaint-X.Y.Z

# git checkout maint-10.0.0
git checkout maint-X.Y.Z
# git merge release-10.0.0-rc0
git merge release-X.Y.Z-rcN
# git push -u apache maint-10.0.0
git push -u apache maint-X.Y.Z
將新發佈新增到 Apache Reporter System

將 Arrow 的相關發佈資料新增到 Apache reporter

推送發佈標籤並建立 GitHub 發佈

提交者必須將發佈標籤推送到 GitHub

# dev/release/post-01-tag.sh 0.1.0 0
dev/release/post-01-tag.sh <version> <rc>
上傳來源發佈工件到 Subversion

PMC 成員必須將來源發佈工件提交到 Subversion

# dev/release/post-02-upload.sh 0.1.0 0
dev/release/post-02-upload.sh <version> <rc>
上傳二進位發佈工件到 Artifactory

提交者必須將二進位發佈工件上傳到 Artifactory 並建立 GitHub 發佈

# dev/release/post-03-binary.sh 0.1.0 0
dev/release/post-03-binary.sh <version> <rc number>
更新網站

為新版本在我們的網站上新增發佈說明,並更新最新的發佈資訊

## Prepare your fork of https://github.com/apache/arrow-site .
## You need to do this only once.
# git clone git@github.com:kou/arrow-site.git ../
git clone git@github.com:<YOUR_GITHUB_ID>/arrow-site.git ../
cd ../arrow-site
## Add git@github.com:apache/arrow-site.git as "apache" remote.
git remote add apache git@github.com:apache/arrow-site.git
cd -

## Generate a release note for the new version, update the
## latest release information automatically.
# dev/release/post-04-website.sh 9.0.0 10.0.0
dev/release/post-04-website.sh OLD_X.OLD_Y.OLD_Z X.Y.Z

此腳本會將 release-note-X.Y.Z 分支推送到您的 apache/arrow-site fork。您需要在您的 Web 瀏覽器上從 release-note-X.Y.Z 分支開啟 pull request。

更新 apache/arrow GitHub 發佈中的發佈說明

提交者必須執行以下腳本。這必須在來自「更新網站」腳本的 Pull Request 合併後完成

# dev/release/post-05-update-gh-release-notes.sh 17.0.0
dev/release/post-05-update-gh-release-notes.sh <version>
更新 Homebrew 套件

開啟一個 pull request 給 Homebrew

## You need to run this on macOS or Linux that Homebrew is installed.

## Fork https://github.com/Homebrew/homebrew-core on GitHub.
## You need to do this only once.
##
## Prepare your fork of https://github.com/Homebrew/homebrew-core .
## You need to do this only once.
cd "$(brew --repository homebrew/core)"
# git remote add kou git@github.com:kou/homebrew-core.git
git remote add <YOUR_GITHUB_ID> git@github.com:<YOUR_GITHUB_ID>/homebrew-core.git
cd -

# dev/release/post-14-homebrew.sh 10.0.0 kou
dev/release/post-14-homebrew.sh X.Y.Z <YOUR_GITHUB_ID>

此腳本會將 apache-arrow-X.Y.Z 分支推送到您的 Homebrew/homebrew-core fork。您需要在您的 Web 瀏覽器上從 apache-arrow-X.Y.Z 分支建立一個 pull request,標題為 apache-arrow, apache-arrow-glib: X.Y.Z

更新 MSYS2 套件

開啟一個 pull request 給 MSYS2

## Fork https://github.com/msys2/MINGW-packages on GitHub.
## You need to do this only once.
##
## Prepare your fork of https://github.com/msys2/MINGW-packages .
## You need to do this only once.
# git clone git@github.com:kou/MINGW-packages.git ../
git clone git@github.com:<YOUR_GITHUB_ID>/MINGW-packages.git ../
cd ../MINGW-packages
## Add https://github.com/msys2/MINGW-packages.git as "upstream" remote.
git remote add upstream https://github.com/msys2/MINGW-packages.git
cd -

# dev/release/post-13-msys2.sh 10.0.0 ../MINGW-packages
dev/release/post-13-msys2.sh X.Y.Z <YOUR_MINGW_PACKAGES_FORK>

此腳本會將 arrow-X.Y.Z 分支推送到您的 msys2/MINGW-packages fork。您需要在您的 Web 瀏覽器上從 arrow-X.Y.Z 分支建立一個 pull request,標題為 arrow: Update to X.Y.Z

更新 RubyGems

您需要在 https://rubygems.org/ 上擁有帳戶才能發佈 Ruby 套件。

如果您在 https://rubygems.org/ 上擁有帳戶,則需要加入我們 gem 的擁有者。

現有的擁有者可以使用以下命令列將新帳戶新增到他們的擁有者中

# dev/release/account-ruby.sh raulcd
dev/release/account-ruby.sh NEW_ACCOUNT

在 Homebrew 套件和 MSYS2 套件更新後更新 RubyGems

# dev/release/post-06-ruby.sh 10.0.0
dev/release/post-06-ruby.sh X.Y.Z
更新 JavaScript 套件

為了將二進位建置發佈到 npm,您需要透過詢問 https://www.npmjs.com/package/apache-arrow 套件中列出的目前協作者之一來取得專案的存取權。

套件上傳需要安裝 npm 和 yarn,並且在您的帳戶上設定 2FA。

當您擁有存取權時,您可以執行以下腳本將發佈發佈到 npm

# Login to npmjs.com (You need to do this only for the first time)
npm login --registry=https://registry.yarnpkg.com/

# dev/release/post-07-js.sh 10.0.0
dev/release/post-07-js.sh X.Y.Z
更新 C# 套件

您需要在 https://www.nuget.org/ 上擁有帳戶。您需要加入 Apache.Arrow 套件的擁有者。現有的擁有者可以在 https://www.nuget.org/packages/Apache.Arrow/Manage 邀請您成為擁有者。

您需要在 https://www.nuget.org/account/apikeys 建立 API 金鑰,才能從命令列上傳。

https://dotnet.microsoft.com/download 安裝最新的 .NET Core SDK。

# NUGET_API_KEY=YOUR_NUGET_API_KEY dev/release/post-08-csharp.sh 10.0.0
NUGET_API_KEY=<your NuGet API key> dev/release/post-08-csharp.sh X.Y.Z
上傳 wheels/sdist 到 PyPI

pip 二進位套件(稱為「wheels」)和來源套件(稱為「sdist」)是使用我們在發佈候選版本建立過程中使用的 crossbow 工具建置的,然後上傳到 PyPI(Python 套件索引)在 pyarrow 套件下。

我們使用 twine 工具將 wheels 上傳到 PyPI

# dev/release/post-11-python.sh 10.0.0
dev/release/post-11-python.sh <version>
更新 R 套件

為了在 CRAN 上發佈 R 套件,我們首先需要執行幾個步驟,以確保 Windows 和 macOS 的二進位檔可供 CRAN 使用。Jeroen Ooms <jeroenooms@gmail.com> 維護了幾個專案,這些專案為 macOS 和 Windows 的 R 套件建置 C++ 依賴項。我們在 CI 中測試這些相同建置腳本的副本,並且在發佈時,我們需要發送我們所做的任何變更並更新上游的版本/雜湊。

在建立發佈候選版本時,使用 rc 建立到每個儲存庫的草稿 pull request,更新版本和 SHA,以及 apache/arrow 中對應檔案中的任何 cmake 建置變更。Jeroen 可以在發佈投票通過之前合併這些 PR,建置二進位工件,並將它們發佈在正確的位置,以便我們可以進行預提交檢查(請參閱下文)。在發佈候選版本投票通過後,更新這些 PR 以指向官方(非 rc)URL 並將它們標記為準備好審查。Jeroen 將合併、建置二進位工件,並將它們發佈在正確的位置。有關必須在提交到 CRAN 之前建立的 pull request 的精確列表,請參閱 封裝檢查清單

一旦滿足這些二進位先決條件,我們就可以提交到 CRAN。考慮到此過程的不可預測性,最好由專案中的 R 開發人員驗證套件是否符合 CRAN 的要求,然後再提交。我們的 CI 系統為我們提供 CRAN 檢查的一些項目的覆蓋範圍,但我們應該進行幾個最終測試,以確認發佈二進位檔可以運作,並且所有內容都在與 CRAN 相同的基礎架構上執行,這很難/不可能使用 Docker 完全模擬。有關檢查的精確列表,請參閱 封裝檢查清單

一旦所有檢查都通過,我們就提交到 CRAN,CRAN 有一個用於上傳套件的 Web 表單。發佈過程需要 R 套件維護者(目前為 Neal Richardson)的電子郵件確認。

更新 vcpkg port

開啟一個 pull request 給 vcpkg

## Fork https://github.com/microsoft/vcpkg on GitHub.
## You need to do this only once.
##
## Prepare your fork of https://github.com/microsoft/vcpkg .
## You need to do this only once.
# git clone git@github.com:kou/vcpkg.git ../
git clone git@github.com:<YOUR_GITHUB_ID>/vcpkg.git ../
cd ../vcpkg
./bootstrap-vcpkg.sh
## Add https://github.com/microsoft/vcpkg.git as "upstream" remote.
git remote add upstream https://github.com/microsoft/vcpkg.git
cd -

# dev/release/post-15-vcpkg.sh 10.0.0 ../vcpkg
dev/release/post-15-vcpkg.sh X.Y.Z <YOUR_VCPKG_FORK>

此腳本會將 arrow-X.Y.Z 分支推送到您的 microsoft/vcpkg fork。您需要在您的 Web 瀏覽器上從 arrow-X.Y.Z 分支建立一個 pull request,標題為 [arrow] Update to X.Y.Z

更新 Conan port

開啟一個 pull request 給 Conan

## Fork https://github.com/conan-io/conan-center-index on GitHub.
## You need to do this only once.
##
## Prepare your fork of https://github.com/conan-io/conan-center-index .
## You need to do this only once.
# git clone git@github.com:kou/conan-center-index.git ../
git clone git@github.com:<YOUR_GITHUB_ID>/conan-center-index.git ../
cd ../conan-center-index
## Add https://github.com/conan-io/conan-center-index.git as "upstream" remote.
git remote add upstream https://github.com/conan-io/conan-center-index.git
cd -

# dev/release/post-16-conan.sh 10.0.1 ../conan-center-index
dev/release/post-16-conan.sh X.Y.Z <YOUR_CONAN_CENTER_INDEX_FORK>

此腳本會將 arrow-X.Y.Z 分支推送到您的 conan-io/conan-center-index fork。您需要在您的 Web 瀏覽器上從 arrow-X.Y.Z 分支建立一個 pull request。

Bump 版本
# You can run the script with BUMP_TAG=0 and BUMP_PUSH=0
# this will avoid default pushing to main and pushing the tag
# but you will require to push manually after reviewing the commits.
# dev/release/post-12-bump-versions.sh 10.0.0 11.0.0
dev/release/post-12-bump-versions.sh X.Y.Z NEXT_X.NEXT_Y.NEXT_Z
更新文件

文件是在發佈過程中產生的。我們只需要上傳產生的文件

## Prepare your fork of https://github.com/apache/arrow-site .
## You need to do this only once.
# git clone git@github.com:kou/arrow-site.git ../
git clone git@github.com:<YOUR_GITHUB_ID>/arrow-site.git ../
cd ../arrow-site
## Add git@github.com:apache/arrow-site.git as "apache" remote.
git remote add apache git@github.com:apache/arrow-site.git
cd -

# dev/release/post-10-docs.sh 10.0.0 9.0.0
dev/release/post-10-docs.sh X.Y.Z PREVIOUS_X.PREVIOUS_Y.PREVIOUS_Z

此腳本會將 release-docs-X.Y.Z 分支推送到您的 arrow-site fork。您需要建立一個 Pull Request 並使用 asf-site 分支作為其基礎。

更新 Apache Arrow Cookbook 中的版本

請遵循 Apache Arrow Cookbook 儲存庫中的 文件

公告新發佈

撰寫發佈公告(請參閱 範例)並發送到 announce@apache.orgdev@arrow.apache.org

發送到 announce@apache.org 的公告必須從您的 apache.org 電子郵件地址發送才能被接受。

發佈發佈部落格文章

部落格文章發佈流程並非自動化。我們通常採取的步驟大致如下

  • Clone apache/arrow-site

  • 為我們正在建立的部落格文章 pull request 從 main 建立新分支。

  • _posts 子資料夾中複製最近的部落格文章條目,並更新檔名和 YAML metadata。

    • 將檔名和 YAML metadata 中的日期設定為發佈的發佈候選版本投票討論串關閉的日期 (GMT)。

  • 僅限次要發佈,移除任何關於社群更新的章節(新提交者、PMC 成員等)。

  • 根據需要更新其餘文字

  • 建立 pull request

  • 在 pull request 中,ping 每個章節中的貢獻者,請求協助填寫每個章節的詳細資訊。

在社群媒體上公告發佈

在社群媒體上發佈關於發佈的消息並連結到部落格文章。此專案有兩個官方帳戶

PMC 成員有權限或可以請求權限以在這些帳戶下發佈訊息。

移除舊工件

移除 https://dist.apache.org/repos/dist/dev/arrow/ 上的 RC 工件和 https://dist.apache.org/repos/dist/release/arrow 上的舊發佈工件,以遵循 ASF 政策

dev/release/post-09-remove-old-artifacts.sh

注意:此步驟必須由 PMC 成員完成。