Skip to content

Commit 595828f

Browse files
committed
[SPARK-52254][INFRA] Adds a GitHub Actions workflow to convert RC to the official release
1 parent 6ee2101 commit 595828f

File tree

1 file changed

+43
-5
lines changed

1 file changed

+43
-5
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
# - GPG_PASSPHRASE:
3939
# The passphrase for your GPG private key.
4040
#
41+
# - PYPI_API_TOKEN:
42+
# When you finalize the release, PyPI API token is required. It can be created in
43+
# https://pypi.org/manage/account/ once you have the permission to the projects in:
44+
# - https://pypi.org/project/pyspark/
45+
# - https://pypi.org/project/pyspark-connect/
46+
# - https://pypi.org/project/pyspark-client/
47+
# Ask [email protected] to have the permission if you do not have.
48+
#
4149
# This workflow supports dry runs by default. If the required GitHub Secrets are not provided,
4250
# only dry runs will be executed.
4351
#
@@ -57,7 +65,7 @@
5765
#
5866
# 4. Drop the staging repository if it exists (https://repository.apache.org/#stagingRepositories)
5967

60-
name: Release Apache Spark (dryrun and RC)
68+
name: Release Apache Spark
6169

6270
on:
6371
schedule:
@@ -70,10 +78,17 @@ on:
7078
release-version:
7179
description: 'Release version. Leave it empty to launch a dryrun.'
7280
required: false
81+
rc-count:
82+
description: 'RC number. Leave it empty to launch a dryrun.'
83+
required: false
84+
finalize:
85+
description: 'Whether to convert RC to the official release (IRREVERSIBLE)'
86+
required: true
87+
default: false
7388

7489
jobs:
7590
release:
76-
name: Release Apache Spark (dryrun and RC)
91+
name: Release Apache Spark
7792
runs-on: ubuntu-latest
7893
# Do not allow dispatching this workflow manually in the main repo.
7994
if: ${{ !(github.repository == 'apache/spark' && inputs.branch != '' && inputs.release-version != '') }}
@@ -83,21 +98,41 @@ jobs:
8398
with:
8499
repository: apache/spark
85100
ref: "${{ inputs.branch }}"
86-
- name: Release Apache Spark (dryrun and RC)
101+
- name: Release Apache Spark
87102
env:
88103
GIT_BRANCH: "${{ inputs.branch }}"
89104
RELEASE_VERSION: "${{ inputs.release-version }}"
105+
SPARK_RC_COUNT: "${{ inputs.rc-count }}"
106+
IS_FINALIZE: "${{ inputs.finalize }}"
90107
GIT_NAME: "${{ github.actor }}"
91108
ASF_USERNAME: "${{ secrets.ASF_USERNAME }}"
92109
ASF_PASSWORD: "${{ secrets.ASF_PASSWORD }}"
93110
GPG_PRIVATE_KEY: "${{ secrets.GPG_PRIVATE_KEY }}"
94111
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"
112+
PYPI_API_TOKEN: "${{ secrets.PYPI_API_TOKEN }}"
95113
DEBUG_MODE: 1
96114
ANSWER: y
97115
run: |
116+
if [ "$IS_FINALIZE" = "true" ]; then
117+
echo ""
118+
echo "┌────────────────────────────────────────────────────────────────────────────┐"
119+
echo "│ !!! WARNING !!! │"
120+
echo "├────────────────────────────────────────────────────────────────────────────┤"
121+
echo "│ This step will CONVERT THE RC ARTIFACTS into THE OFFICIAL RELEASE. │"
122+
echo "│ │"
123+
echo "│ This action is IRREVERSIBLE. │"
124+
echo "│ │"
125+
echo "│ The workflow will continue in 60 seconds. │"
126+
echo "│ Cancel this workflow now if you do NOT intend to finalize the release. │"
127+
echo "└────────────────────────────────────────────────────────────────────────────┘"
128+
echo ""
129+
130+
sleep 60
131+
fi
132+
98133
empty_count=0
99134
non_empty_count=0
100-
for val in "$GIT_BRANCH" "$RELEASE_VERSION"; do
135+
for val in "$GIT_BRANCH" "$RELEASE_VERSION" "$SPARK_RC_COUNT"; do
101136
if [ -z "$val" ]; then
102137
empty_count=$((empty_count+1))
103138
else
@@ -110,7 +145,7 @@ jobs:
110145
exit 1
111146
fi
112147
113-
if [ "$empty_count" -eq 2 ]; then
148+
if [ "$empty_count" -eq 3 ]; then
114149
echo "Dry run mode enabled"
115150
export DRYRUN_MODE=1
116151
ASF_PASSWORD="not_used"
@@ -152,6 +187,9 @@ jobs:
152187
if [ "$DRYRUN_MODE" = "1" ]; then
153188
CMD="$CMD -n"
154189
fi
190+
if [ "$IS_FINALIZE" = "true" ]; then
191+
CMD="$CMD -s finalize"
192+
fi
155193
156194
echo "Running release command: $CMD"
157195

0 commit comments

Comments
 (0)