Skip to content

Commit cda5eb0

Browse files
committed
Fix deploy script so as not to push release version
1 parent 8686318 commit cda5eb0

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

.travis.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,4 @@ jdk:
1212
- oraclejdk8
1313

1414
script:
15-
- if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ]; then
16-
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
17-
sbt ++$TRAVIS_SCALA_VERSION "; test; publish";
18-
else
19-
sbt ++$TRAVIS_SCALA_VERSION test;
20-
fi;
21-
else
22-
sbt ++$TRAVIS_SCALA_VERSION test;
23-
fi
15+
- ./script/travis-deploy.sh

scripts/travis-deploy.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -ev
3+
4+
VERSION=`perl -npe "s/version in ThisBuild\s+:=\s+\"(.*)\"/\1/" version.sbt | sed -e "/^$/d"`
5+
6+
# Deploy a snapshot version only for master branch and jdk8
7+
if [[ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ]]; then
8+
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ "$VERSION" == *SNAPSHOT ]]; then
9+
sbt ++$TRAVIS_SCALA_VERSION "; test; publish";
10+
else
11+
sbt ++$TRAVIS_SCALA_VERSION test;
12+
fi;
13+
else
14+
sbt ++$TRAVIS_SCALA_VERSION test;
15+
fi;

0 commit comments

Comments
 (0)