forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-1577: [JS] add ASF release scripts
@wesm does [this](apache@b270dba#diff-fc8acbd4f42fb5e6b0cad14928b68115R59) look good? Author: Paul Taylor <[email protected]> Author: Wes McKinney <[email protected]> Closes apache#1346 from trxcllnt/js-asf-release-scripts and squashes the following commits: ac246cd [Wes McKinney] Update npm-release.sh while integration testing from release tarball is hard 469beea [Wes McKinney] Add to READMEs about how to release and verify JS release 160f5c3 [Paul Taylor] remove tag-version-prefix from npmrc 854020d [Wes McKinney] Run unit tests without integration tests for now 9485922 [Wes McKinney] Add JavaScript release verification script dd06c46 [Wes McKinney] Create tag in source release script 2c6ce86 [Paul Taylor] number of npm-release.sh script arguments is 0 e1c3a96 [Paul Taylor] npm install before release, use npm version --git-tag-version with tag-version-prefix 5870043 [Wes McKinney] Number of arguments is 2 1133fb8 [Wes McKinney] Remove upstream Arrow version tag. Bump JS version to 0.2.0 30b602f [Paul Taylor] add dev/release/js-source-release.sh script be82c08 [Paul Taylor] add npm-release.sh script to publish npm modules f72fc83 [Paul Taylor] update test_js commands in verify-release-candidate.sh 5194951 [Paul Taylor] npm pack the js sources into the release tarball d73c47a [Paul Taylor] prepare js lib for release 7d9c84a [Paul Taylor] remove tslib patches as it doesn't work on windows
- Loading branch information
Showing
14 changed files
with
292 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#!/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 | ||
|
||
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
if [ "$#" -ne 2 ]; then | ||
echo "Usage: $0 <js-version> <rc-num>" | ||
exit | ||
fi | ||
|
||
js_version=$1 | ||
rc=$2 | ||
|
||
tag=apache-arrow-js-${js_version} | ||
tagrc=${tag}-rc${rc} | ||
|
||
echo "Preparing source for tag ${tag}" | ||
|
||
tarball=${tag}.tar.gz | ||
|
||
# cd to $ARROW_HOME/js | ||
cd $SOURCE_DIR/../../js | ||
JS_SRC_DIR="$PWD" | ||
# npm pack the js source files | ||
npm install | ||
|
||
npm version --no-git-tag-version $js_version | ||
git add package.json | ||
git commit -m "[Release] Apache Arrow JavaScript $js_version" | ||
git tag -a ${tag} | ||
|
||
release_hash=`git rev-list $tag 2> /dev/null | head -n 1 ` | ||
|
||
if [ -z "$release_hash" ]; then | ||
echo "Cannot continue: unknown git tag: $tag" | ||
exit | ||
fi | ||
|
||
echo "Using commit $release_hash" | ||
|
||
cd $SOURCE_DIR | ||
|
||
rm -rf js-tmp | ||
# `npm pack` writes the .tgz file to the current dir, so cd into js-tmp | ||
mkdir -p js-tmp | ||
cd js-tmp | ||
# run npm pack on `arrow/js` | ||
npm pack ${JS_SRC_DIR} | ||
# unzip and remove the npm pack tarball | ||
tar -xzf *.tgz && rm *.tgz | ||
# `npm pack` puts files in a dir called "package" | ||
cp $JS_SRC_DIR/../NOTICE.txt package | ||
cp $JS_SRC_DIR/../LICENSE.txt package | ||
# rename "package" to $tag | ||
mv package ${tag} | ||
tar czf ${tarball} ${tag} | ||
rm -rf ${tag} | ||
|
||
${SOURCE_DIR}/run-rat.sh ${tarball} | ||
|
||
# sign the archive | ||
gpg --armor --output ${tarball}.asc --detach-sig ${tarball} | ||
gpg --print-md MD5 ${tarball} > ${tarball}.md5 | ||
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 | ||
|
||
# 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} | ||
|
||
cd - | ||
|
||
# clean up | ||
rm -rf js-tmp | ||
|
||
echo "Success! The release candidate is available here:" | ||
echo " https://dist.apache.org/repos/dist/dev/arrow/${tagrc}" | ||
echo "" | ||
echo "Commit SHA1: ${release_hash}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/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. | ||
# | ||
|
||
# Requirements | ||
# - nodejs >= 6.0.0 (best way is to use nvm) | ||
|
||
case $# in | ||
2) VERSION="$1" | ||
RC_NUMBER="$2" | ||
;; | ||
|
||
*) echo "Usage: $0 X.Y.Z RC_NUMBER" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
set -ex | ||
|
||
HERE=$(cd `dirname "${BASH_SOURCE[0]:-$0}"` && pwd) | ||
|
||
ARROW_DIST_URL='https://dist.apache.org/repos/dist/dev/arrow' | ||
|
||
download_dist_file() { | ||
curl -f -O $ARROW_DIST_URL/$1 | ||
} | ||
|
||
download_rc_file() { | ||
download_dist_file apache-arrow-js-${VERSION}-rc${RC_NUMBER}/$1 | ||
} | ||
|
||
import_gpg_keys() { | ||
download_dist_file KEYS | ||
gpg --import KEYS | ||
} | ||
|
||
fetch_archive() { | ||
local dist_name=$1 | ||
download_rc_file ${dist_name}.tar.gz | ||
download_rc_file ${dist_name}.tar.gz.asc | ||
download_rc_file ${dist_name}.tar.gz.md5 | ||
download_rc_file ${dist_name}.tar.gz.sha512 | ||
gpg --verify ${dist_name}.tar.gz.asc ${dist_name}.tar.gz | ||
gpg --print-md MD5 ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.md5 | ||
if [ "$(uname)" == "Darwin" ]; then | ||
shasum -a 512 ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha512 | ||
else | ||
sha512sum ${dist_name}.tar.gz | diff - ${dist_name}.tar.gz.sha512 | ||
fi | ||
} | ||
|
||
setup_tempdir() { | ||
cleanup() { | ||
rm -fr "$TMPDIR" | ||
} | ||
trap cleanup EXIT | ||
TMPDIR=$(mktemp -d -t "$1.XXXXX") | ||
} | ||
|
||
setup_tempdir "arrow-js-$VERSION" | ||
echo "Working in sandbox $TMPDIR" | ||
cd $TMPDIR | ||
|
||
VERSION=$1 | ||
RC_NUMBER=$2 | ||
|
||
TARBALL=apache-arrow-js-$1.tar.gz | ||
|
||
import_gpg_keys | ||
|
||
DIST_NAME="apache-arrow-js-${VERSION}" | ||
fetch_archive $DIST_NAME | ||
tar xvzf ${DIST_NAME}.tar.gz | ||
cd ${DIST_NAME} | ||
|
||
npm install | ||
# npx run-s clean:all lint create:testdata build | ||
# npm run test -- -t ts -u --integration | ||
# npm run test -- --integration | ||
npx run-s clean:all lint build | ||
npm run test | ||
|
||
echo 'Release candidate looks good!' | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
save-prefix= | ||
package-lock=false | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.