-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-41102: [Packaging][Release] Create unique git tags for release can…
…didates (e.g. apache-arrow-{MAJOR}.{MINOR}.{PATCH}-rc{RC_NUM}) (#41131) ### Rationale for this change As per @ kou's [suggestion](#40956 (comment)) in #40956, we should create unique git tags (e.g. `apache-arrow-{MAJOR}.{MINOR}.{VERSION}-rc{RC_NUM}`) instead re-using the same git tag (`apache-arrow-{MAJOR}.{MINOR}.{VERSION}`) for each release candidate. The official release candidate tag (`apache-arrow-{MAJOR}.{MINOR}.{VERSION}`) should be created **only** after a release candidate is voted on and accepted. This "official" release tag should point to the same object in the git database as the accepted release candidate tag. The new release workflow could look like the following: > 1. Create a apache-arrow-X.Y.Z-rc0 tag for X.Y.Z RC0 > 2. (Found a problem for X.Y.Z RC0) > 3. Create a apache-arrow-X.Y.Z-rc1 tag for X.Y.Z RC1 > 4. Vote > 5. Passed > 6. Create a apache-arrow-X.Y.Z tag from apache-arrow-X.Y.Z-rc1 ike apache/arrow-adbc and apache/arrow-flight-sql-postgresql do See @ kou's [comment](#40956 (comment)) for more details. ### What changes are included in this PR? 1. Updated `dev/release/01-prepare.sh` to create release-candidate-specific git tags (e.g. `apache-arrow-{MAJOR}.{MINOR}.{PATCH}-rc{RC_NUM}`). 2. Updated scripts in `dev/release` to use the new git tag name. 3. Added GitHub Workflow file `publish_release_candidate.yml`. This workflow is triggered when a release candidate git tag is pushed and creates a Prerelease GitHub Release. 4. Added logic to `dev/release/02-post-binary.sh` to create and push the release git tag (i.e. `apache-arrow-{MAJOR}.{MINOR}.{PATCH}`). 5. Added GitHub Workflow `publish_release.yml`. This workflow is triggered when the release tag is pushed and creates a GitHub Release for the approved release (i.e. the voted upon release). 6. Added `dev/release/post-16-delete-release-candidates.sh` to delete the release candidate git tags and their associated GitHub Releases. 7. Updated `docs/developers/release.rst` with the new steps. ### Are these changes tested? 1. We were not able to verify the changes made to the scripts in `dev/release`. Any suggestions on how we can verify these scripts would be much appreciated :) 2. We did test the new GitHub Workflows (`publish_release_candidate.yml` and `publish_release.yml`) work as intended by pushing git tags to [`mathworks/arrow`](https://github.com/mathworks/arrow). ### Are there any user-facing changes? No. ### Open Questions 1. We noticed that [apache/arrow-flight-sql-postgresql](https://github.com/apache/arrow-flight-sql-postgresql/releases) does **not** delete the release candidate Prereleases from their GitHub Releases area. Should we be doing the same? Or would it be preferable to just delete the the release candidates **without** deleting the release candidate tags. 2. We're not that familiar with ruby, so we're not sure if the changes we made to `dev/release/02-source-test.rb` make sense. ### Future Directions 1. Continue working on #40956 2. Add logic to auto-sign release artifacts in GitHub Actions Workflows. * GitHub Issue: #41102 Lead-authored-by: Sarah Gilmore <[email protected]> Co-authored-by: Sarah Gilmore <[email protected]> Co-authored-by: Sutou Kouhei <[email protected]> Signed-off-by: Sarah Gilmore <[email protected]>
- Loading branch information
1 parent
680980e
commit 6ec2f22
Showing
30 changed files
with
523 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
# Trigger workflow when a tag whose name matches the pattern | ||
# pattern "apache-arrow-{MAJOR}.{MINOR}.{PATCH}" is pushed. | ||
- "apache-arrow-[0-9]+.[0-9]+.[0-9]+" | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Get Tag Name of Latest Release Candidate | ||
run: | | ||
rc_tag=$(gh release list --repo apache/arrow | \ | ||
cut -f3 | \ | ||
grep -F "${GITHUB_REF_NAME}-rc" | \ | ||
head -n1) | ||
echo "Latest Release Candidate Tag: ${rc_tag}" | ||
echo "RELEASE_CANDIDATE_TAG_NAME=${rc_tag}" >> ${GITHUB_ENV} | ||
- name: Store Version and Release Candidate Number | ||
run: | | ||
version_with_rc=${RELEASE_CANDIDATE_TAG_NAME#apache-arrow-} | ||
version=${version_with_rc%-rc*} | ||
rc_num=${version_with_rc#${version}-rc} | ||
echo "VERSION_WITH_RC=${version_with_rc}" >> ${GITHUB_ENV} | ||
echo "VERSION=${version}" >> ${GITHUB_ENV} | ||
echo "RC_NUM=${rc_num}" >> ${GITHUB_ENV} | ||
- name: Download Release Candidate Artifacts | ||
run: | | ||
mkdir release_candidate_artifacts | ||
gh release download ${RELEASE_CANDIDATE_TAG_NAME} --repo apache/arrow --dir release_candidate_artifacts | ||
- name: Create Release Title | ||
run: | | ||
title="Apache Arrow ${VERSION}" | ||
echo "RELEASE_TITLE=${title}" >> ${GITHUB_ENV} | ||
# Set the release notes to "TODO" temporarily. After the release notes page | ||
# (https://arrow.apache.org/release/{VERSION}.html) is published, use | ||
# gh release edit to update the release notes to refer to the newly | ||
# pushed web page. See dev/post/post-05-update-gh-release-notes.sh | ||
- name: Create GitHub Release | ||
run: | | ||
gh release create ${GITHUB_REF_NAME} \ | ||
--repo apache/arrow \ | ||
--verify-tag \ | ||
--title "${RELEASE_TITLE}" \ | ||
--notes "TODO" \ | ||
release_candidate_artifacts/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
# Trigger workflow when a tag whose name matches the pattern | ||
# "apache-arrow-{MAJOR}.{MINOR}.{PATCH}-rc{RC_NUM}" is pushed. | ||
- "apache-arrow-[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout Arrow | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Store Version and Release Candidate Number | ||
run: | | ||
version_with_rc=${GITHUB_REF_NAME#apache-arrow-} | ||
version=${version_with_rc%-rc*} | ||
rc_num=${version_with_rc#${version}-rc} | ||
echo "VERSION_WITH_RC=${version_with_rc}" >> ${GITHUB_ENV} | ||
echo "VERSION=${version}" >> ${GITHUB_ENV} | ||
echo "RC_NUM=${rc_num}" >> ${GITHUB_ENV} | ||
- name: Create Release Candidate Title | ||
run: | | ||
title="Apache Arrow ${VERSION} RC${RC_NUM}" | ||
echo "RELEASE_CANDIDATE_TITLE=${title}" >> ${GITHUB_ENV} | ||
- name: Create Release Candidate Notes | ||
run: | | ||
release_notes="Release Candidate: ${VERSION} RC${RC_NUM}" | ||
echo "RELEASE_CANDIDATE_NOTES=${release_notes}" >> ${GITHUB_ENV} | ||
- name: Create Release tarball | ||
run: | | ||
cd dev/release/ && ./utils-create-release-tarball.sh ${VERSION} ${RC_NUM} | ||
echo "RELEASE_TARBALL=apache-arrow-${VERSION}.tar.gz" >> ${GITHUB_ENV} | ||
- name: Create GitHub Release | ||
run: | | ||
gh release create ${GITHUB_REF_NAME} \ | ||
--verify-tag \ | ||
--prerelease \ | ||
--title "${RELEASE_CANDIDATE_TITLE}" \ | ||
--notes "Release Notes: ${RELEASE_CANDIDATE_NOTES}" \ | ||
dev/release/${RELEASE_TARBALL} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.