pushing version folder for builds on master

This commit is contained in:
Yotam Mann 2017-08-30 12:45:31 -04:00
parent 8979fba85d
commit 37c6c79628
2 changed files with 14 additions and 7 deletions

View file

@ -7,9 +7,6 @@ TONE_DIR=$(pwd)/..
BUILD_DIR=$TMP_DIR/build
echo tone dir: $TONE_DIR
echo build dir: $BUILD_DIR
# clone the build repo
if [ "$TRAVIS" = "true" ]; then
GITHUB_USER=${GH_TOKEN}@
@ -19,11 +16,10 @@ git clone https://${GITHUB_USER}github.com/Tonejs/build $BUILD_DIR > /dev/null 2
cd $BUILD_DIR
git checkout gh-pages
echo travis branch: $TRAVIS_BRANCH
# generate a new build
gulp build
# push to the appropriate location
if [ "$TRAVIS" = "true" ]; then
@ -31,14 +27,18 @@ if [ "$TRAVIS" = "true" ]; then
if [ "$TRAVIS_BRANCH" = "dev" ]; then
# dev builds go into the dev folder
mkdir $BUILD_DIR/test/
cp -a $TONE_DIR/build/. $BUILD_DIR/test/
cp -a $TONE_DIR/build/. $BUILD_DIR/dev/
elif [ "$TRAVIS_BRANCH" = "master" ]; then
# master builds are on the root level folder
cp -a $TONE_DIR/build/. $BUILD_DIR/
# and also in a folder with the version name
VERSION=$(node $TONE_DIR/gulp/version.js $TONE_DIR)
mkdir $BUILD_DIR/$VERSION
cp -a $TONE_DIR/build/. $BUILD_DIR/$VERSION
fi
fi

7
gulp/version.js Executable file
View file

@ -0,0 +1,7 @@
const fs = require('fs')
var VERSION = fs.readFileSync(`${process.argv[2]}/Tone/core/Tone.js`, 'utf-8')
.match(/(?:Tone\.version\s*=\s*)(?:'|")(.*)(?:'|");/m)[1];
console.log(VERSION)