@@ -25,15 +25,29 @@ SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2525source " ${SOURCE_DIR} /utils-common.sh"
2626source " ${SOURCE_DIR} /utils-prepare.sh"
2727
28+ # arrow-c-data-18.2.0-sources.jar ->
29+ # jar
30+ extract_type () {
31+ local path=" $1 "
32+ echo " ${path} " | grep -o " [^.]*$"
33+ }
34+
35+ # arrow-c-data-18.2.0-sources.jar arrow-c-data-18.2.0 ->
36+ # sources
37+ extract_classifier () {
38+ local path=" $1 "
39+ local base=" $2 "
40+ basename " ${path} " | sed -e " s/^${base} -//g" -e " s/\.[^.]*$//g"
41+ }
42+
2843main () {
29- if [ $# -ne 2 ]; then
30- echo " Usage: $0 <arrow-dir> < rc-number>"
31- echo " Usage: $0 ../arrow 0"
44+ if [ $# -ne 1 ]; then
45+ echo " Usage: $0 <rc-number>"
46+ echo " Usage: $0 0"
3247 exit
3348 fi
3449
35- local -r arrow_dir=" $( cd " $1 " && pwd) "
36- local -r rc_number=" $2 "
50+ local -r rc_number=" $1 "
3751 local -r tag=" apache-arrow-adbc-${RELEASE} -rc${rc_number} "
3852
3953 export ARROW_ARTIFACTS_DIR=" $( pwd) /packages/${tag} /java"
@@ -48,8 +62,72 @@ main() {
4862 --repo " ${REPOSITORY} " \
4963 " ${tag} "
5064
51- export UPLOAD_FORCE_SIGN=0
52- " ${arrow_dir} /dev/release/06-java-upload.sh" " ${RELEASE} " " ${rc_number} "
65+ pushd " ${ARROW_ARTIFACTS_DIR} "
66+
67+ for pom in * .pom; do
68+ base=$( basename " ${pom} " .pom)
69+ files=()
70+ types=()
71+ classifiers=()
72+ args=() # Args to Maven
73+ args+=(deploy:deploy-file)
74+ args+=(-Durl=https://repository.apache.org/service/local/staging/deploy/maven2)
75+ args+=(-DrepositoryId=apache.releases.https)
76+ args+=(-DretryFailedDeploymentCount=10)
77+ args+=(-DpomFile=" ${pom} " )
78+ if [ -f " ${base} .jar" ]; then
79+ jar=" ${base} .jar"
80+ args+=(-Dfile=" ${jar} " )
81+ files+=(" ${base} .jar.asc" )
82+ types+=(" jar.asc" )
83+ classifiers+=(" " )
84+ else
85+ args+=(-Dfile=" ${pom} " )
86+ fi
87+ files+=(" ${base} .pom.asc" )
88+ types+=(" pom.asc" )
89+ classifiers+=(" " )
90+ if [ " $( echo " ${base} " -* ) " != " ${base} -*" ]; then
91+ for other_file in " ${base} " -* ; do
92+ type=" $( extract_type " ${other_file} " ) "
93+ case " ${type} " in
94+ asc | sha256 | sha512)
95+ continue
96+ ;;
97+ esac
98+ classifier=$( extract_classifier " ${other_file} " " ${base} " )
99+ files+=(" ${other_file} " )
100+ types+=(" ${type} " )
101+ classifiers+=(" ${classifier} " )
102+ other_file_base=" $( basename " ${other_file} " ) "
103+ files+=(" ${other_file_base} .asc" )
104+ types+=(" ${type} .asc" )
105+ classifiers+=(" ${classifier} " )
106+ done
107+ fi
108+ args+=(-Dfiles=" $(
109+ IFS=,
110+ echo " ${files[*]} "
111+ ) " )
112+ args+=(-Dtypes=" $(
113+ IFS=,
114+ echo " ${types[*]} "
115+ ) " )
116+ args+=(-Dclassifiers=" $(
117+ IFS=,
118+ echo " ${classifiers[*]} "
119+ ) " )
120+ mvn " ${args[@]} "
121+ done
122+
123+ popd
124+
125+ echo " Success!"
126+ echo " Press the 'Close' button in the web interface:"
127+ echo " https://repository.apache.org/#stagingRepositories"
128+ echo " It publishes the artifacts to the staging repository:"
129+ echo " https://repository.apache.org/content/repositories/staging/org/apache/arrow/"
130+ read -p " After publishing the artifacts, press ENTER to continue..." ignored
53131}
54132
55133main " $@ "
0 commit comments