Skip to content

Apache DataFusion SQL Query Engine

ARROW-6103: [Release][Java] Remove mvn release plugin

Krisztián Szűcs35e13ae7bfc8
diff --git a/dev/release/00-prepare-test.rb b/dev/release/01-prepare-test.rb
similarity index 99%
rename from dev/release/00-prepare-test.rb
rename to dev/release/01-prepare-test.rb
index 9e2a798e22..b316ad20a9 100644
--- a/dev/release/00-prepare-test.rb
+++ b/dev/release/01-prepare-test.rb
@@ -31,7 +31,7 @@ class PrepareTest < Test::Unit::TestCase
Dir.chdir(@test_git_repository) do
@tag_name = "apache-arrow-#{@release_version}"
@release_branch = "release-#{@release_version}-rc0"
- @script = "dev/release/00-prepare.sh"
+ @script = "dev/release/01-prepare.sh"
git("checkout", "-b", @release_branch, @current_commit)
yield
end
@@ -54,7 +54,7 @@ class PrepareTest < Test::Unit::TestCase
env["PREPARE_#{target}"] = "1"
end
env = env.merge(additional_env)
- sh(env, @script, @release_version, @next_version)
+ sh(env, @script, @release_version, @next_version, "0")
end
def parse_patch(patch)
diff --git a/dev/release/00-prepare.sh b/dev/release/01-prepare.sh
similarity index 83%
rename from dev/release/00-prepare.sh
rename to dev/release/01-prepare.sh
index 3e3ce19656..80703c2d87 100755
--- a/dev/release/00-prepare.sh
+++ b/dev/release/01-prepare.sh
@@ -21,8 +21,8 @@ set -ue
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-if [ "$#" -ne 2 ]; then
- echo "Usage: $0 <version> <next_version>"
+if [ "$#" -ne 3 ]; then
+ echo "Usage: $0 <version> <next_version> <rc-num>"
exit 1
fi
@@ -172,17 +172,47 @@ update_versions() {
version=$1
next_version=$2
-next_version_snapshot=${next_version}-SNAPSHOT
-tag=apache-arrow-${version}
+next_version_snapshot="${next_version}-SNAPSHOT"
+rc_number=$3
+
+release_tag="apache-arrow-${version}"
+release_branch="release-${version}"
+release_candidate_branch="release-${version}-rc${rc_number}"
: ${PREPARE_DEFAULT:=1}
: ${PREPARE_CHANGELOG:=${PREPARE_DEFAULT}}
: ${PREPARE_LINUX_PACKAGES:=${PREPARE_DEFAULT}}
: ${PREPARE_VERSION_PRE_TAG:=${PREPARE_DEFAULT}}
+: ${PREPARE_BRANCH:=${PREPARE_DEFAULT}}
: ${PREPARE_TAG:=${PREPARE_DEFAULT}}
: ${PREPARE_VERSION_POST_TAG:=${PREPARE_DEFAULT}}
: ${PREPARE_DEB_PACKAGE_NAMES:=${PREPARE_DEFAULT}}
+if [ ${PREPARE_TAG} -gt 0 ]; then
+ if [ $(git tag -l "${release_tag}") ]; then
+ echo "Delete existing git tag $release_tag"
+ git tag -d "${release_tag}"
+ fi
+fi
+
+if [ ${PREPARE_BRANCH} -gt 0 ]; then
+ if [[ $(git branch -l "${release_candidate_branch}") ]]; then
+ next_rc_number=$(($rc_number+1))
+ echo "Branch ${release_candidate_branch} already exists, so create a new release candidate:"
+ echo "1. Checkout the master branch for major releases and maint-<version> for patch releases."
+ echo "2. Execute the script again with bumped RC number."
+ echo "Commands:"
+ echo " git checkout master"
+ echo " dev/release/01-prepare.sh ${version} ${next_version} ${next_rc_number}"
+ exit 1
+ fi
+
+ echo "Create local branch ${release_candidate_branch} for release candidate ${rc_number}"
+ git checkout -b ${release_candidate_branch}
+fi
+
+############################## Pre-Tag Commits ##############################
+
if [ ${PREPARE_CHANGELOG} -gt 0 ]; then
echo "Updating changelog for $version"
# Update changelog
@@ -204,40 +234,16 @@ if [ ${PREPARE_LINUX_PACKAGES} -gt 0 ]; then
fi
if [ ${PREPARE_VERSION_PRE_TAG} -gt 0 ]; then
- echo "prepare release ${version} on tag ${tag} then reset to version ${next_version_snapshot}"
+ echo "Prepare release ${version} on tag ${release_tag} then reset to version ${next_version_snapshot}"
update_versions "${version}" "${next_version}" "release"
git commit -m "[Release] Update versions for ${version}"
fi
+############################## Tag the Release ##############################
+
if [ ${PREPARE_TAG} -gt 0 ]; then
- profile=arrow-jni # this includes components which depend on arrow cpp.
- pushd "${SOURCE_DIR}/../../java"
- git submodule update --init --recursive
- cpp_dir="${PWD}/../cpp"
- cpp_build_dir=$(mktemp -d -t "apache-arrow-cpp.XXXXX")
- pushd ${cpp_build_dir}
- cmake \
- -DARROW_GANDIVA=ON \
- -DARROW_GANDIVA_JAVA=ON \
- -DARROW_JNI=ON \
- -DARROW_ORC=ON \
- -DCMAKE_BUILD_TYPE=release \
- -G Ninja \
- "${cpp_dir}"
- ninja
- popd
- mvn release:clean
- mvn \
- release:prepare \
- -Darguments=-Darrow.cpp.build.dir=${cpp_build_dir}/release \
- -DautoVersionSubmodules \
- -DdevelopmentVersion=${next_version_snapshot} \
- -DreleaseVersion=${version} \
- -Dtag=${tag} \
- -P ${profile}
- rm -rf ${cpp_build_dir}
- popd
+ git tag -a "${release_tag}" -m "[Release] Apache Arrow Release ${version}"
fi
############################## Post-Tag Commits #############################
@@ -283,5 +289,3 @@ if [ ${PREPARE_DEB_PACKAGE_NAMES} -gt 0 ]; then
cd -
fi
fi
-
-echo "Finish staging binary artifacts by running: dev/release/01-perform.sh"
diff --git a/dev/release/03-binary-submit.sh b/dev/release/03-binary-submit.sh
new file mode 100755
index 0000000000..1bdbc2077b
--- /dev/null
+++ b/dev/release/03-binary-submit.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 <version> <rc-num>"
+ exit
+fi
+
+version=$1
+rc_number=$2
+version_with_rc="${version}-rc${rc_number}"
+crossbow_job_prefix="release-${version_with_rc}"
+
+release_tag="apache-arrow-${version}"
+release_candidate_branch="release-${version}-rc${rc_number}"
+
+: ${GIT_REMOTE:="origin"}
+
+git checkout ${release_candidate_branch}
+git push -u ${GIT_REMOTE} ${release_candidate_branch}
+
+# archery will submit a job with id: "${crossbow_job_prefix}-0" unless there
+# are jobs submitted with the same prefix (the integer at the end is auto
+# incremented)
+archery crossbow submit \
+ --job-prefix ${crossbow_job_prefix} \
+ --arrow-version ${version_with_rc} \
+ --group packaging
diff --git a/dev/release/01-perform.sh b/dev/release/04-binary-download.sh
similarity index 55%
rename from dev/release/01-perform.sh
rename to dev/release/04-binary-download.sh
index 94ae61f4a2..d0b61b0588 100755
--- a/dev/release/01-perform.sh
+++ b/dev/release/04-binary-download.sh
@@ -17,34 +17,22 @@
# specific language governing permissions and limitations
# under the License.
#
-set -e
-
-SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-pushd "${SOURCE_DIR}/../../java"
-git submodule update --init --recursive
+set -e
-profile=arrow-jni # this includes components which depend on arrow cpp.
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 <version> <rc-num>"
+ exit
+fi
-cpp_dir="${PWD}/../cpp"
-cpp_build_dir=$(mktemp -d -t "apache-arrow-cpp.XXXXX")
-pushd ${cpp_build_dir}
-cmake \
- -DARROW_GANDIVA=ON \
- -DARROW_GANDIVA_JAVA=ON \
- -DARROW_JNI=ON \
- -DARROW_ORC=ON \
- -DCMAKE_BUILD_TYPE=release \
- -G Ninja \
- "${cpp_dir}"
-ninja
-popd
+version=$1
+rc_number=$2
+version_with_rc="${version}-rc${rc_number}"
+crossbow_job_prefix="release-${version_with_rc}"
-export ARROW_TEST_DATA=${PWD}/../testing/data
-mvn \
- release:perform \
- -Darguments=-Darrow.cpp.build.dir=${cpp_build_dir}/release \
- -P ${profile}
-rm -rf ${cpp_build_dir}
+# archery will submit a job with id: "${crossbow_job_prefix}-0" unless there
+# are jobs submitted with the same prefix (the integer at the end is auto
+# incremented)
+: ${CROSSBOW_JOB_ID:="${crossbow_job_prefix}-0"}
-popd
+archery crossbow download-artifacts ${CROSSBOW_JOB_ID}
diff --git a/dev/release/03-binary.sh b/dev/release/05-binary-upload.sh
similarity index 91%
rename from dev/release/03-binary.sh
rename to dev/release/05-binary-upload.sh
index 3b845a1bdf..4a360c28b0 100755
--- a/dev/release/03-binary.sh
+++ b/dev/release/05-binary-upload.sh
@@ -23,19 +23,20 @@ set -o pipefail
SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-if [ "$#" -ne 3 ]; then
- echo "Usage: $0 <version> <rc-num> <artifact-dir>"
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 <version> <rc-num>"
exit
fi
version=$1
rc=$2
-artifact_dir=$3
-if [ -z "$artifact_dir" ]; then
- echo "artifact_dir is empty"
- exit 1
-fi
+version_with_rc="${version}-rc${rc}"
+crossbow_job_prefix="release-${version_with_rc}"
+crossbow_package_dir="${SOURCE_DIR}/../../packages"
+
+: ${CROSSBOW_JOB_ID:="${crossbow_job_prefix}-0"}
+artifact_dir="${crossbow_package_dir}/${CROSSBOW_JOB_ID}"
if [ ! -e "$artifact_dir" ]; then
echo "$artifact_dir does not exist"
@@ -47,8 +48,6 @@ if [ ! -d "$artifact_dir" ]; then
exit 1
fi
-artifact_dir="$(pwd)/${artifact_dir}"
-
cd "${SOURCE_DIR}"
: ${BINTRAY_REPOSITORY_CUSTOM:=${BINTRAY_REPOSITORY:-}}
diff --git a/dev/release/post-11-java.sh b/dev/release/post-11-java.sh
new file mode 100755
index 0000000000..d9dc32a7f5
--- /dev/null
+++ b/dev/release/post-11-java.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+set -o pipefail
+
+SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+if [ "$#" -ne 1 ]; then
+ echo "Usage: $0 <version>"
+ exit
+fi
+
+version=$1
+archive_name=apache-arrow-${version}
+tar_gz=${archive_name}.tar.gz
+
+rm -f ${tar_gz}
+curl \
+ --remote-name \
+ --fail \
+ https://downloads.apache.org/arrow/arrow-${version}/${tar_gz}
+rm -rf ${archive_name}
+tar xf ${tar_gz}
+
+# build the jni bindings similarly like the 01-perform.sh does
+mkdir -p ${archive_name}/cpp/java-build
+pushd ${archive_name}/cpp/java-build
+cmake \
+ -DARROW_GANDIVA=ON \
+ -DARROW_GANDIVA_JAVA=ON \
+ -DARROW_JNI=ON \
+ -DARROW_ORC=ON \
+ -DCMAKE_BUILD_TYPE=release \
+ -G Ninja \
+ ..
+ninja
+popd
+
+# go in the java subfolder
+pushd ${archive_name}/java
+# stage the artifacts using both the apache-release and arrow-jni profiles
+mvn -Papache-release,arrow-jni -Darrow.cpp.build.dir=$(realpath ../cpp/java-build) deploy
+popd
+
+echo "Success! The maven artifacts have been stated. Proceed with the following steps:"
+echo "1. Login to the apache repository: https://repository.apache.org/#stagingRepositories"
+echo "2. Select the arrow staging repository you just just created: orgapachearrow-100x"
+echo "3. Click the \"close\" button"
+echo "4. Once validation has passed, click the \"release\" button"
+echo ""
+echo "Note, that you must set up Maven to be able to publish to Apache's repositories."
+echo "Read more at https://www.apache.org/dev/publishing-maven-artifacts.html."