Skip to content

Commit dc0bfca

Browse files
authored
chore(dev/release): update the Java release upload process (apache#2565)
The script was removed from apache/arrow after Java as moved to apache/arrow-java. The new script is not as easily reused so inline it here instead. Fixes apache#2451.
1 parent 15fb244 commit dc0bfca

File tree

2 files changed

+88
-10
lines changed

2 files changed

+88
-10
lines changed

dev/release/04-java-upload.sh

Lines changed: 85 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,29 @@ SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2525
source "${SOURCE_DIR}/utils-common.sh"
2626
source "${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+
2843
main() {
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

55133
main "$@"

docs/source/development/releasing.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ Build source and binaries and submit them
171171
172172
# Upload the Java artifacts
173173
#
174-
# Note that you need to press the "Close" button manually by Web interface
175-
# after you complete the script:
174+
# Note that you need to press the "Close" button manually in the Web
175+
# interface after you complete the script:
176176
# https://repository.apache.org/#stagingRepositories
177-
dev/release/04-java-upload.sh <arrow-dir> <rc-number>
177+
dev/release/04-java-upload.sh <rc-number>
178178
179179
# Sign and upload the deb/rpm packages and APT/Yum repositories
180180
#

0 commit comments

Comments
 (0)