@@ -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,102 @@ 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+=(-DpomFile=" ${pom} " )
172+ if [ -f " ${artifacts_dir} /${base} .jar" ]; then
173+ jar=" ${artifacts_dir} /${base} .jar"
174+ args+=(-Dfile=" ${jar} " )
175+ files+=(" ${signed_artifacts_dir} /${base} .jar.asc" )
176+ types+=(" jar.asc" )
177+ classifiers+=(" " )
178+ else
179+ args+=(-Dfile=" ${pom} " )
180+ fi
181+ files+=(" ${signed_artifacts_dir} /${base} .pom.asc" )
182+ types+=(" pom.asc" )
183+ classifiers+=(" " )
184+ if [ " $( echo " ${artifacts_dir} /${base} " -* ) " != " ${artifacts_dir} /${base} -*" ]; then
185+ for other_file in " ${artifacts_dir} /${base} " -* ; do
186+ type=" $( extract_type " ${other_file} " ) "
187+ case " ${type} " in
188+ sha256 | sha512)
189+ continue
190+ ;;
191+ esac
192+ classifier=$( extract_classifier " ${other_file} " " ${base} " )
193+ files+=(" ${other_file} " )
194+ types+=(" ${type} " )
195+ classifiers+=(" ${classifier} " )
196+ other_file_base=" $( basename " ${other_file} " ) "
197+ files+=(" ${signed_artifacts_dir} /${other_file_base} .asc" )
198+ types+=(" ${type} .asc" )
199+ classifiers+=(" ${classifier} " )
200+ done
201+ fi
202+ args+=(-Dfiles=" $(
203+ IFS=,
204+ echo " ${files[*]} "
205+ ) " )
206+ args+=(-Dtypes=" $(
207+ IFS=,
208+ echo " ${types[*]} "
209+ ) " )
210+ args+=(-Dclassifiers=" $(
211+ IFS=,
212+ echo " ${classifiers[*]} "
213+ ) " )
214+ mvn " ${args[@]} "
215+ done
216+
217+ echo
218+ echo " Success!"
219+ echo " Press the 'Close' button manually by Web interface:"
220+ echo " https://repository.apache.org/#stagingRepositories"
221+ echo " It publishes the artifacts to the staging repository:"
222+ echo " https://repository.apache.org/content/repositories/staging/org/apache/arrow/"
136223fi
137224
225+ echo
138226echo " Draft email for dev@arrow.apache.org mailing list"
139227echo " "
140228echo " ---------------------------------------------------------"
0 commit comments