57
57
#
58
58
# 4. Drop the staging repository if it exists (https://repository.apache.org/#stagingRepositories)
59
59
60
- name : Release Apache Spark (dryrun and RC)
60
+ name : Release Apache Spark
61
61
62
62
on :
63
63
schedule :
70
70
release-version :
71
71
description : ' Release version. Leave it empty to launch a dryrun.'
72
72
required : false
73
+ rc-count :
74
+ description : ' RC number. Leave it empty to launch a dryrun.'
75
+ required : false
76
+ finalize :
77
+ description : ' Whether to convert RC to the official release (IRREVERSIBLE)'
78
+ required : true
79
+ default : false
73
80
74
81
jobs :
75
82
release :
76
- name : Release Apache Spark (dryrun and RC)
83
+ name : Release Apache Spark
77
84
runs-on : ubuntu-latest
78
85
# Do not allow dispatching this workflow manually in the main repo.
79
86
if : ${{ !(github.repository == 'apache/spark' && inputs.branch != '' && inputs.release-version != '') }}
@@ -83,21 +90,41 @@ jobs:
83
90
with :
84
91
repository : apache/spark
85
92
ref : " ${{ inputs.branch }}"
86
- - name : Release Apache Spark (dryrun and RC)
93
+ - name : Release Apache Spark
87
94
env :
88
95
GIT_BRANCH : " ${{ inputs.branch }}"
89
96
RELEASE_VERSION : " ${{ inputs.release-version }}"
97
+ SPARK_RC_COUNT : " ${{ inputs.rc-count }}"
98
+ IS_FINALIZE : " ${{ inputs.finalize }}"
90
99
GIT_NAME : " ${{ github.actor }}"
91
100
ASF_USERNAME : " ${{ secrets.ASF_USERNAME }}"
92
101
ASF_PASSWORD : " ${{ secrets.ASF_PASSWORD }}"
93
102
GPG_PRIVATE_KEY : " ${{ secrets.GPG_PRIVATE_KEY }}"
94
103
GPG_PASSPHRASE : " ${{ secrets.GPG_PASSPHRASE }}"
104
+ PYPI_API_TOKEN : " ${{ secrets.PYPI_API_TOKEN }}"
95
105
DEBUG_MODE : 1
96
106
ANSWER : y
97
107
run : |
108
+ if [ "$IS_FINALIZE" = "true" ]; then
109
+ echo ""
110
+ echo "┌────────────────────────────────────────────────────────────────────────────┐"
111
+ echo "│ !!! WARNING !!! │"
112
+ echo "├────────────────────────────────────────────────────────────────────────────┤"
113
+ echo "│ This step will CONVERT THE RC ARTIFACTS into THE OFFICIAL RELEASE. │"
114
+ echo "│ │"
115
+ echo "│ This action is IRREVERSIBLE. │"
116
+ echo "│ │"
117
+ echo "│ The workflow will continue in 60 seconds. │"
118
+ echo "│ Cancel this workflow now if you do NOT intend to finalize the release. │"
119
+ echo "└────────────────────────────────────────────────────────────────────────────┘"
120
+ echo ""
121
+
122
+ sleep 60
123
+ fi
124
+
98
125
empty_count=0
99
126
non_empty_count=0
100
- for val in "$GIT_BRANCH" "$RELEASE_VERSION"; do
127
+ for val in "$GIT_BRANCH" "$RELEASE_VERSION" "$SPARK_RC_COUNT" ; do
101
128
if [ -z "$val" ]; then
102
129
empty_count=$((empty_count+1))
103
130
else
@@ -110,7 +137,7 @@ jobs:
110
137
exit 1
111
138
fi
112
139
113
- if [ "$empty_count" -eq 2 ]; then
140
+ if [ "$empty_count" -eq 3 ]; then
114
141
echo "Dry run mode enabled"
115
142
export DRYRUN_MODE=1
116
143
ASF_PASSWORD="not_used"
@@ -152,6 +179,9 @@ jobs:
152
179
if [ "$DRYRUN_MODE" = "1" ]; then
153
180
CMD="$CMD -n"
154
181
fi
182
+ if [ "$IS_FINALIZE" = "true" ]; then
183
+ CMD="$CMD -s finalize"
184
+ fi
155
185
156
186
echo "Running release command: $CMD"
157
187
0 commit comments