38
38
# - GPG_PASSPHRASE:
39
39
# The passphrase for your GPG private key.
40
40
#
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
+ #
41
49
# This workflow supports dry runs by default. If the required GitHub Secrets are not provided,
42
50
# only dry runs will be executed.
43
51
#
57
65
#
58
66
# 4. Drop the staging repository if it exists (https://repository.apache.org/#stagingRepositories)
59
67
60
- name : Release Apache Spark (dryrun and RC)
68
+ name : Release Apache Spark
61
69
62
70
on :
63
71
schedule :
70
78
release-version :
71
79
description : ' Release version. Leave it empty to launch a dryrun.'
72
80
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
73
88
74
89
jobs :
75
90
release :
76
- name : Release Apache Spark (dryrun and RC)
91
+ name : Release Apache Spark
77
92
runs-on : ubuntu-latest
78
93
# Do not allow dispatching this workflow manually in the main repo.
79
94
if : ${{ !(github.repository == 'apache/spark' && inputs.branch != '' && inputs.release-version != '') }}
@@ -83,21 +98,41 @@ jobs:
83
98
with :
84
99
repository : apache/spark
85
100
ref : " ${{ inputs.branch }}"
86
- - name : Release Apache Spark (dryrun and RC)
101
+ - name : Release Apache Spark
87
102
env :
88
103
GIT_BRANCH : " ${{ inputs.branch }}"
89
104
RELEASE_VERSION : " ${{ inputs.release-version }}"
105
+ SPARK_RC_COUNT : " ${{ inputs.rc-count }}"
106
+ IS_FINALIZE : " ${{ inputs.finalize }}"
90
107
GIT_NAME : " ${{ github.actor }}"
91
108
ASF_USERNAME : " ${{ secrets.ASF_USERNAME }}"
92
109
ASF_PASSWORD : " ${{ secrets.ASF_PASSWORD }}"
93
110
GPG_PRIVATE_KEY : " ${{ secrets.GPG_PRIVATE_KEY }}"
94
111
GPG_PASSPHRASE : " ${{ secrets.GPG_PASSPHRASE }}"
112
+ PYPI_API_TOKEN : " ${{ secrets.PYPI_API_TOKEN }}"
95
113
DEBUG_MODE : 1
96
114
ANSWER : y
97
115
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
+
98
133
empty_count=0
99
134
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
101
136
if [ -z "$val" ]; then
102
137
empty_count=$((empty_count+1))
103
138
else
@@ -110,7 +145,7 @@ jobs:
110
145
exit 1
111
146
fi
112
147
113
- if [ "$empty_count" -eq 2 ]; then
148
+ if [ "$empty_count" -eq 3 ]; then
114
149
echo "Dry run mode enabled"
115
150
export DRYRUN_MODE=1
116
151
ASF_PASSWORD="not_used"
@@ -152,6 +187,9 @@ jobs:
152
187
if [ "$DRYRUN_MODE" = "1" ]; then
153
188
CMD="$CMD -n"
154
189
fi
190
+ if [ "$IS_FINALIZE" = "true" ]; then
191
+ CMD="$CMD -s finalize"
192
+ fi
155
193
156
194
echo "Running release command: $CMD"
157
195
0 commit comments