Skip to content

Commit

Permalink
Script to create release tarballs
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed May 16, 2021
1 parent 1fc48da commit 06ea148
Showing 1 changed file with 114 additions and 0 deletions.
114 changes: 114 additions & 0 deletions dev/release/create-tarball.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#!/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.
#


# This script creates a signed tarball in dev/dist/apache-arrow-<version>.tar.gz
# and uploads it to the "dev" area of dist.apache.arrow (NOT an official release)
#
# Based in part on 02-source.sh from apache/arrow

set -e

SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SOURCE_TOP_DIR="$(cd "${SOURCE_DIR}/../../" && pwd)"

if [ "$#" -ne 1 ]; then
echo "Usage: $0 <tag>"
exit
fi

tag=$1

release=apache-arrow-rs-${tag}
distdir=${SOURCE_TOP_DIR}/dev/dist/${release}
tarball=${distdir}/${release}.tar.gz
url="https://dist.apache.org/repos/dist/dev/arrow/${release}"

echo "Attempting to create ${tarball} from tag ${tag}"

release_hash=$(cd "${SOURCE_TOP_DIR}" && git rev-list --max-count=1 ${tag})


if [ -z "$release_hash" ]; then
echo "Cannot continue: unknown git tag: $tag"
fi

# create <tarball> containing the files in git at $release_hash
# the files in the tarball are prefixed with {tag} (e.g. 4.0.1)
mkdir -p ${distdir}
(cd "${SOURCE_TOP_DIR}" && git archive ${release_hash} --prefix ${tag}/ | gzip > ${tarball})

echo "Running rat license checker on ${tarball}"
${SOURCE_DIR}/run-rat.sh ${tarball}

echo "Signing tarball and creating checksums"
gpg --armor --output ${tarball}.asc --detach-sig ${tarball}
shasum -a 256 $tarball > ${tarball}.sha256
shasum -a 512 $tarball > ${tarball}.sha512


echo "Uploading to apache dist/dev to ${url}"
svn co --depth=empty https://dist.apache.org/repos/dist/dev/arrow ${SOURCE_TOP_DIR}/dev/dist
svn add ${distdir}
svn ci -m "Apache Arrow Rust ${tag}" ${distdir}

echo "Draft email for [email protected] mailing list"
echo ""
echo "---------------------------------------------------------"
jira_url="https://issues.apache.org/jira"
jql="project%20%3D%20ARROW%20AND%20status%20in%20%28Resolved%2C%20Closed%29%20AND%20fixVersion%20%3D%20${version}"
n_resolved_issues=$(curl "${jira_url}/rest/api/2/search/?jql=${jql}" | jq ".total")
cat <<MAIL
To: [email protected]
Subject: [VOTE] Release Apache Arrow ${version} - RC${rc}
Hi,
I would like to propose the following release candidate (RC${rc}) of Apache
Arrow version ${version}. This is a release consisting of ${n_resolved_issues}
resolved JIRA issues[1].
This release candidate is based on commit:
${release_hash} [2]
The source release rc${rc} is hosted at [3].
The binary artifacts are hosted at [4][5][6][7].
The changelog is located at [8].
Please download, verify checksums and signatures, run the unit tests,
and vote on the release. See [9] for how to validate a release candidate.
The vote will be open for at least 72 hours.
[ ] +1 Release this as Apache Arrow ${version}
[ ] +0
[ ] -1 Do not release this as Apache Arrow ${version} because...
[1]: ${jira_url}/issues/?jql=${jql}
[2]: https://github.com/apache/arrow/tree/${release_hash}
[3]: ${rc_url}
[4]: https://apache.jfrog.io/artifactory/arrow/centos-rc/${version}-rc${rc}
[5]: https://apache.jfrog.io/artifactory/arrow/debian-rc/${version}-rc${rc}
[6]: https://apache.jfrog.io/artifactory/arrow/python-rc/${version}-rc${rc}
[7]: https://apache.jfrog.io/artifactory/arrow/ubuntu-rc/${version}-rc${rc}
[8]: https://github.com/apache/arrow/blob/${release_hash}/CHANGELOG.md
[9]: https://cwiki.apache.org/confluence/display/ARROW/How+to+Verify+Release+Candidates
MAIL
echo "---------------------------------------------------------"

0 comments on commit 06ea148

Please sign in to comment.