Fix deploy script so as not to push release version

This commit is contained in:
Taro L. Saito 2017-12-01 16:07:29 -08:00
parent 8686318c2c
commit cda5eb03e2
2 changed files with 16 additions and 9 deletions

View File

@ -12,12 +12,4 @@ jdk:
- oraclejdk8 - oraclejdk8
script: script:
- if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ]; then - ./script/travis-deploy.sh
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
sbt ++$TRAVIS_SCALA_VERSION "; test; publish";
else
sbt ++$TRAVIS_SCALA_VERSION test;
fi;
else
sbt ++$TRAVIS_SCALA_VERSION test;
fi

15
scripts/travis-deploy.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
set -ev
VERSION=`perl -npe "s/version in ThisBuild\s+:=\s+\"(.*)\"/\1/" version.sbt | sed -e "/^$/d"`
# Deploy a snapshot version only for master branch and jdk8
if [[ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ]]; then
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ "$VERSION" == *SNAPSHOT ]]; then
sbt ++$TRAVIS_SCALA_VERSION "; test; publish";
else
sbt ++$TRAVIS_SCALA_VERSION test;
fi;
else
sbt ++$TRAVIS_SCALA_VERSION test;
fi;