@@ -84,6 +84,13 @@ artifacts_dir="apache-arrow-java-${version}-rc${rc}"
8484signed_artifacts_dir=" ${artifacts_dir} -signed"
8585
8686if [ " ${RELEASE_SIGN} " -gt 0 ]; then
87+ if [ ! -f " ${SOURCE_DIR} /.env" ]; then
88+ echo " You must create ${SOURCE_DIR} /.env"
89+ echo " You can use ${SOURCE_DIR} /.env.example as template"
90+ exit 1
91+ fi
92+ . " ${SOURCE_DIR} /.env"
93+
8794 git_origin_url=" $( git remote get-url origin) "
8895 repository=" ${git_origin_url#* github.com?} "
8996 repository=" ${repository% .git} "
@@ -120,21 +127,103 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then
120127 continue
121128 ;;
122129 esac
123- gpg --armor \
130+ gpg \
131+ --armor \
124132 --detach-sig \
133+ --local-user " ${GPG_KEY_ID} " \
125134 --output " ${signed_artifacts_dir} /$( basename " ${artifact} " ) .asc" \
126135 " ${artifact} "
127136 done
128137fi
129138
139+ # arrow-c-data-18.2.0-sources.jar ->
140+ # jar
141+ extract_type () {
142+ local path=" $1 "
143+ echo " ${path} " | grep -o " [^.]*$"
144+ }
145+
146+ # arrow-c-data-18.2.0-sources.jar arrow-c-data-18.2.0 ->
147+ # sources
148+ extract_classifier () {
149+ local path=" $1 "
150+ local base=" $2 "
151+ basename " ${path} " | sed -e " s/^${base} -//g" -e " s/\.[^.]*$//g"
152+ }
153+
130154if [ " ${RELEASE_UPLOAD} " -gt 0 ]; then
131155 echo " Uploading signature"
132156 gh release upload " ${rc_tag} " \
133157 --clobber \
134158 --repo " ${repository} " \
135159 " ${signed_artifacts_dir} " /* .asc
160+
161+ echo " Uploading packages"
162+ for pom in " ${artifacts_dir} " /* .pom; do
163+ base=$( basename " ${pom} " .pom)
164+ files=()
165+ types=()
166+ classifiers=()
167+ args=()
168+ args+=(deploy:deploy-file)
169+ args+=(-Durl=https://repository.apache.org/service/local/staging/deploy/maven2)
170+ args+=(-DrepositoryId=apache.releases.https)
171+ args+=(-DretryFailedDeploymentCount=10)
172+ args+=(-DpomFile=" ${pom} " )
173+ if [ -f " ${artifacts_dir} /${base} .jar" ]; then
174+ jar=" ${artifacts_dir} /${base} .jar"
175+ args+=(-Dfile=" ${jar} " )
176+ files+=(" ${signed_artifacts_dir} /${base} .jar.asc" )
177+ types+=(" jar.asc" )
178+ classifiers+=(" " )
179+ else
180+ args+=(-Dfile=" ${pom} " )
181+ fi
182+ files+=(" ${signed_artifacts_dir} /${base} .pom.asc" )
183+ types+=(" pom.asc" )
184+ classifiers+=(" " )
185+ if [ " $( echo " ${artifacts_dir} /${base} " -* ) " != " ${artifacts_dir} /${base} -*" ]; then
186+ for other_file in " ${artifacts_dir} /${base} " -* ; do
187+ type=" $( extract_type " ${other_file} " ) "
188+ case " ${type} " in
189+ sha256 | sha512)
190+ continue
191+ ;;
192+ esac
193+ classifier=$( extract_classifier " ${other_file} " " ${base} " )
194+ files+=(" ${other_file} " )
195+ types+=(" ${type} " )
196+ classifiers+=(" ${classifier} " )
197+ other_file_base=" $( basename " ${other_file} " ) "
198+ files+=(" ${signed_artifacts_dir} /${other_file_base} .asc" )
199+ types+=(" ${type} .asc" )
200+ classifiers+=(" ${classifier} " )
201+ done
202+ fi
203+ args+=(-Dfiles=" $(
204+ IFS=,
205+ echo " ${files[*]} "
206+ ) " )
207+ args+=(-Dtypes=" $(
208+ IFS=,
209+ echo " ${types[*]} "
210+ ) " )
211+ args+=(-Dclassifiers=" $(
212+ IFS=,
213+ echo " ${classifiers[*]} "
214+ ) " )
215+ mvn " ${args[@]} "
216+ done
217+
218+ echo
219+ echo " Success!"
220+ echo " Press the 'Close' button manually by Web interface:"
221+ echo " https://repository.apache.org/#stagingRepositories"
222+ echo " It publishes the artifacts to the staging repository:"
223+ echo " https://repository.apache.org/content/repositories/staging/org/apache/arrow/"
136224fi
137225
226+ echo
138227echo " Draft email for [email protected] mailing list" 139228echo " "
140229echo " ---------------------------------------------------------"
0 commit comments