Skip to content

Apache DataFusion SQL Query Engine

ARROW-2293: [JS] Print release vote e-mail template when making source release

Brian Hulette3d425aafe9a1
diff --git a/dev/release/js-source-release.sh b/dev/release/js-source-release.sh
index 53b31af62f..292869db69 100755
--- a/dev/release/js-source-release.sh
+++ b/dev/release/js-source-release.sh
@@ -21,9 +21,38 @@ set -e
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+function print_help_and_exit {
+cat <<EOF
+Apache Arrow JS release candidate tool.
+
+Usage: $0 [-h] [-p] <js-version> <rc-num>"
+
+ -h Print this help message and exit
+ -p If present, publish the release candidate (default: does not publish anything)
+EOF
+exit 0
+}
+
+publish=0
+while getopts ":hp" opt; do
+ case $opt in
+ p)
+ publish=1
+ ;;
+ h)
+ print_help_and_exit
+ ;;
+ * )
+ echo "Unknown option: -$OPTARG"
+ print_help_and_exit
+ ;;
+ esac
+done
+
+shift $(($OPTIND - 1))
+
if [ "$#" -ne 2 ]; then
- echo "Usage: $0 <js-version> <rc-num>"
- exit
+ print_help_and_exit
fi
js_version=$1
@@ -32,6 +61,17 @@ rc=$2
tag=apache-arrow-js-${js_version}
tagrc=${tag}-rc${rc}
+# Reset instructions
+current_git_rev=$(git rev-parse HEAD)
+function print_reset_instructions {
+cat <<EOF
+To roll back your local repo you will need to run:
+
+ git reset --hard ${current_git_rev}
+ git tag -d ${tag}
+EOF
+}
+
echo "Preparing source for tag ${tag}"
tarball=${tag}.tar.gz
@@ -82,14 +122,16 @@ sha1sum $tarball > ${tarball}.sha1
sha256sum $tarball > ${tarball}.sha256
sha512sum $tarball > ${tarball}.sha512
-# check out the arrow RC folder
-svn co --depth=empty https://dist.apache.org/repos/dist/dev/arrow js-rc-tmp
+if [[ $publish == 1 ]]; then
+ # check out the arrow RC folder
+ svn co --depth=empty https://dist.apache.org/repos/dist/dev/arrow js-rc-tmp
-# add the release candidate for the tag
-mkdir -p js-rc-tmp/${tagrc}
-cp ${tarball}* js-rc-tmp/${tagrc}
-svn add js-rc-tmp/${tagrc}
-svn ci -m 'Apache Arrow JavaScript ${version} RC${rc}' js-rc-tmp/${tagrc}
+ # add the release candidate for the tag
+ mkdir -p js-rc-tmp/${tagrc}
+ cp ${tarball}* js-rc-tmp/${tagrc}
+ svn add js-rc-tmp/${tagrc}
+ svn ci -m 'Apache Arrow JavaScript ${version} RC${rc}' js-rc-tmp/${tagrc}
+fi
cd -
@@ -100,3 +142,61 @@ echo "Success! The release candidate is available here:"
echo " https://dist.apache.org/repos/dist/dev/arrow/${tagrc}"
echo ""
echo "Commit SHA1: ${release_hash}"
+echo ""
+echo "The following draft email has been created to send to the "
+echo "[email protected] mailing list"
+echo ""
+
+# Create the email template for the release candidate to be sent to the mailing lists.
+MESSAGE=$(cat <<__EOF__
+Subject: [VOTE] Release Apache Arrow JS ${js_version} - RC${rc}
+
+Hello all,
+
+I\'d like to propose the following release candidate (rc${rc}) of Apache Arrow
+JavaScript version ${js_version}.
+
+The source release rc{$rc} is hosted at [1].
+
+This release candidate is based on commit
+${release_hash}
+
+Please download, verify checksums and signatures, run the unit tests, and vote
+on the release. The easiest way is to use the JavaScript-specific release
+verification script dev/release/js-verify-release-candidate.sh.
+
+The vote will be open for at least 72 hours and will close once
+enough PMCs have approved the release.
+
+[ ] +1 Release this as Apache Arrow JavaScript ${js_version}
+[ ] +0
+[ ] -1 Do not release this as Apache Arrow JavaScript ${js_version} because...
+
+
+How to validate a release signature:
+https://httpd.apache.org/dev/verification.html
+
+[1]: https://dist.apache.org/repos/dist/dev/arrow/${tagrc}/
+[2]: https://github.com/apache/arrow/tree/${release_hash}
+
+__EOF__
+)
+
+
+echo "--------------------------------------------------------------------------------"
+echo
+echo "${MESSAGE}"
+echo
+echo "--------------------------------------------------------------------------------"
+echo
+
+
+# Print reset instructions if this was a dry-run
+if [[ $publish == 0 ]]; then
+ echo
+ echo "This was a dry run, nothing has been published."
+ echo "To publish, re-run this script with the -p flag."
+ echo
+ print_reset_instructions
+fi