3 # Licensed to the Apache Software Foundation (ASF) under one
4 # or more contributor license agreements. See the NOTICE file
5 # distributed with this work for additional information
6 # regarding copyright ownership. The ASF licenses this file
7 # to you under the Apache License, Version 2.0 (the
8 # "License"); you may not use this file except in compliance
9 # with the License. You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing,
14 # software distributed under the License is distributed on an
15 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 # KIND, either express or implied. See the License for the
17 # specific language governing permissions and limitations
22 SOURCE_DIR
="$( cd "$
( dirname "${BASH_SOURCE[0]}" )" && pwd )"
24 if [ "$#" -ne 3 ]; then
25 echo "Usage: $0 <version> <next_version> <rc-num>"
29 .
$SOURCE_DIR/utils-prepare.sh
33 next_version_snapshot
="${next_version}-SNAPSHOT"
36 release_tag
="apache-arrow-${version}"
37 release_branch
="release-${version}"
38 release_candidate_branch
="release-${version}-rc${rc_number}"
40 : ${PREPARE_DEFAULT:=1}
41 : ${PREPARE_CHANGELOG:=${PREPARE_DEFAULT}}
42 : ${PREPARE_LINUX_PACKAGES:=${PREPARE_DEFAULT}}
43 : ${PREPARE_VERSION_PRE_TAG:=${PREPARE_DEFAULT}}
44 : ${PREPARE_BRANCH:=${PREPARE_DEFAULT}}
45 : ${PREPARE_TAG:=${PREPARE_DEFAULT}}
47 if [ ${PREPARE_TAG} -gt 0 ]; then
48 if [ $
(git tag
-l "${release_tag}") ]; then
49 echo "Delete existing git tag $release_tag"
50 git tag
-d "${release_tag}"
54 if [ ${PREPARE_BRANCH} -gt 0 ]; then
55 if [[ $
(git branch
-l "${release_candidate_branch}") ]]; then
56 next_rc_number
=$
(($rc_number+1))
57 echo "Branch ${release_candidate_branch} already exists, so create a new release candidate:"
58 echo "1. Checkout the master branch for major releases and maint-<version> for patch releases."
59 echo "2. Execute the script again with bumped RC number."
61 echo " git checkout master"
62 echo " dev/release/01-prepare.sh ${version} ${next_version} ${next_rc_number}"
66 echo "Create local branch ${release_candidate_branch} for release candidate ${rc_number}"
67 git checkout
-b ${release_candidate_branch}
70 ############################## Pre-Tag Commits ##############################
72 if [ ${PREPARE_CHANGELOG} -gt 0 ]; then
73 echo "Updating changelog for $version"
75 archery release changelog add
$version
76 git add
${SOURCE_DIR}/..
/..
/CHANGELOG.md
77 git commit
-m "[Release] Update CHANGELOG.md for $version"
80 if [ ${PREPARE_LINUX_PACKAGES} -gt 0 ]; then
81 echo "Updating .deb/.rpm changelogs for $version"
82 cd $SOURCE_DIR/..
/tasks
/linux-packages
85 ARROW_RELEASE_TIME
="$(date +%Y-%m-%dT%H:%M:%S%z)" \
86 ARROW_VERSION
=${version}
87 git add
*/debian
*/changelog
*/yum
/*.spec.
in
88 git commit
-m "[Release] Update .deb/.rpm changelogs for $version"
92 if [ ${PREPARE_VERSION_PRE_TAG} -gt 0 ]; then
93 echo "Prepare release ${version} on tag ${release_tag} then reset to version ${next_version_snapshot}"
95 update_versions
"${version}" "${next_version}" "release"
96 git commit
-m "[Release] Update versions for ${version}"
99 ############################## Tag the Release ##############################
101 if [ ${PREPARE_TAG} -gt 0 ]; then
102 git tag
-a "${release_tag}" -m "[Release] Apache Arrow Release ${version}"