Skip to content

Commit

Permalink
ARROW-14747: [Release] Add a script to merge changes in release branch
Browse files Browse the repository at this point in the history
https://cwiki.apache.org/confluence/display/ARROW/Release+Management+Guide#ReleaseManagementGuide-Post-releasetasks

    1.  [ ] a) open a pull request to bump the version numbers in the
               source code on the development branch (`master` in case of major
               releases and `maint-<version>` for minor and patch releases)

            b) create and push a development tag
               `apache-arrow-<new-version>.dev` to the same development
               branch pointing to the merge commit of the pull request from
               the previous step

Closes #11733 from kou/release-post-merge

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
kou committed Nov 26, 2021
1 parent 43e6a03 commit 35b3567
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 0 deletions.
53 changes: 53 additions & 0 deletions dev/release/post-01-merge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env 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 -u

if [ "$#" -ne 2 ]; then
echo "Usage: $0 <version> <rc-num>"
exit
fi

version=$1
rc=$2

case ${version} in
*.0.0) # Major release
echo "Do nothing for major release"
;;
*.*.0) # Minor release
echo "Minor release isn't supported yet"
exit 1
;;
*) # Patch release
echo "Fetching all commits"
git fetch --all --prune --tags --force -j$(nproc)

release_branch=release-${version}-rc${rc}
maint_branch=maint-$(echo ${version} | sed -e 's/\.[0-9]*$/.x/')
echo "Merging ${release_branch} to ${merge_branch}"
git branch -D ${maint_branch}
git checkout -b ${maint_branch} apache/${maint_branch}
git merge release-${version}-rc${rc}
git push apache ${maint_branch}
git checkout -
;;
*)
esac
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions dev/release/post-12-bump-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,25 @@ if [ "$#" -ne 2 ]; then
fi

: ${BUMP_DEFAULT:=1}
: ${BUMP_UPDATE_LOCAL_MASTER:=${BUMP_DEFAULT}}
: ${BUMP_VERSION_POST_TAG:=${BUMP_DEFAULT}}
: ${BUMP_DEB_PACKAGE_NAMES:=${BUMP_DEFAULT}}
: ${BUMP_PUSH:=${BUMP_DEFAULT}}
: ${BUMP_TAG:=${BUMP_DEFAULT}}

. $SOURCE_DIR/utils-prepare.sh

version=$1
next_version=$2
next_version_snapshot="${next_version}-SNAPSHOT"

if [ ${BUMP_UPDATE_LOCAL_MASTER} -gt 0 ]; then
echo "Updating local master"
git fetch --all --prune --tags --force -j$(nproc)
git checkout master
git rebase apache/master
fi

if [ ${BUMP_VERSION_POST_TAG} -gt 0 ]; then
echo "Updating versions for ${next_version_snapshot}"
update_versions "${version}" "${next_version}" "snapshot"
Expand Down Expand Up @@ -77,3 +87,18 @@ if [ ${BUMP_DEB_PACKAGE_NAMES} -gt 0 ]; then
cd -
fi
fi

if [ ${BUMP_PUSH} -gt 0 ]; then
echo "Pushing changes to the master in apache/arrow"
git push apache master
fi

if [ ${BUMP_TAG} -gt 0 ]; then
version_tag=apache-arrow-${version}
dev_tag=apache-arrow-${next_version}.dev
echo "Tagging ${version_tag} and ${dev_tag}"
git tag ${version_tag} release-${version}
git push apache ${version_tag}
git tag ${dev_tag} master
git push apache ${dev_tag}
fi

0 comments on commit 35b3567

Please sign in to comment.