Skip to content

Commit 8c16a08

Browse files
authored
GH-48000: [CI][Release] Publish RC GitHub Release as draft to allow immutable releases (#48059)
### Rationale for this change GitHub allows repositories to set up immutable GitHub releases. Immutable releases won't allow for artifacts to be published to the release once the release is published and out of draft-mode. The release immutability has to be set up per repository (or organization). ### What changes are included in this PR? Create the Release Candidate GitHub release as draft in order to allow for immutable releases to be set up on the repository. Addition of artifacts will be available to the RC release but won't be available to the official release as we upload all artifacts as part of the release creation. Publish the RC release once no new artifacts have to be uploaded. ### Are these changes tested? Not as part of a release but I've created a release on my fork and tested the workflow. See: https://github.com/raulcd/arrow/releases/tag/raul-test-release-immutable I've validated that when immutable releases are configured on the repository: - artifacts can be uploaded when the release is in draft mode. - Release can be edited on draft mode - Once the draft mode is removed no new artifacts can be uploaded - The release can be edited (add final release notes) when the release is not in draft mode, allowing for our workflow of the release to add the final release notes without problems. ### Are there any user-facing changes? No but users will be able to validate the artifacts have not been updated/changed since the release was done due to immutability. * GitHub Issue: #48000 Authored-by: Raúl Cumplido <[email protected]> Signed-off-by: Raúl Cumplido <[email protected]>
1 parent c10847c commit 8c16a08

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.github/workflows/release_candidate.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ jobs:
112112
GH_TOKEN: ${{ github.token }}
113113
run: |
114114
gh release create ${GITHUB_REF_NAME} \
115+
--draft \
115116
--verify-tag \
116117
--prerelease \
117118
--title "${RELEASE_CANDIDATE_TITLE}" \
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
set -e
21+
set -u
22+
set -o pipefail
23+
24+
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
25+
26+
if [ "$#" -ne 2 ]; then
27+
echo "Usage: $0 <version> <rc-num>"
28+
exit
29+
fi
30+
31+
. "${SOURCE_DIR}/utils-env.sh"
32+
33+
version=$1
34+
rc=$2
35+
REPOSITORY="apache/arrow"
36+
37+
rc_tag="apache-arrow-${version}-rc${rc}"
38+
gh release edit ${rc_tag} --repo ${REPOSITORY} --draft=false

docs/source/developers/release.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ Build source and binaries and submit them
266266
# Start verifications for binaries and wheels
267267
dev/release/07-binary-verify.sh <version> <rc-number>
268268
269+
# Move the Release Candidate GitHub Release from draft to published state
270+
dev/release/08-publish-gh-release.sh <version> <rc-number>
271+
269272
Verify the Release
270273
------------------
271274

0 commit comments

Comments
 (0)