Skip to content

Commit

Permalink
copy over the travis configuration from RxJava to enable triggering a…
Browse files Browse the repository at this point in the history
… releasing via github.
  • Loading branch information
abersnaze committed Mar 3, 2015
1 parent 82ecd89 commit 485b1b0
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,15 @@ language: java

jdk:
- oraclejdk7

sudo: false
# as per http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/

# script for build and release via Travis to Bintray
script: gradle/buildViaTravis.sh

# secure environment variables for release to Bintray
env:
global:
- secure: OPpNQ1KvC3VXnCyvXdR/mIGrmXMVsr8OA5dmhBoXpVNgsLoJy/OWmtaz3dTI2KujZ+68gGG8jnZVo5GAIpTQgn/dN23ImuzMEwWLtEvAsz+bJQw/p8xlFz8cz+9wzbZExv+J7QZ2kCttJN5g2q7+UV1uQo4bbb2EUOR+mqannVI=
- secure: Wvyv3z2Kf0BBWB1urworB+SLpUErQ19GhVV04UEJK6uiXsSuSrtIf3Da8mLZjA11c+cUXh6XaZnppQSHvBQTJ1ujxCQ0gYXIQFEu4jIotV2IinMwpmJxdV9dPndk0I8nLWrpZvouOfipY9shxEYsQnIMFPdBGmAY3AyWBtMEj2Q=
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ dependencies {
testCompile 'junit:junit-dep:4.10'
testCompile 'org.mockito:mockito-core:1.8.5'
}

// support for snapshot/final releases with the various branches RxJava uses
nebulaRelease {
addReleaseBranchPattern(/\d+\.\d+\.\d+/)
addReleaseBranchPattern('HEAD')
}

if (project.hasProperty('release.useLastTag')) {
tasks.prepare.enabled = false
}

3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
version=1.0.0-RC1-SNAPSHOT
release.scope=patch

17 changes: 17 additions & 0 deletions gradle/buildViaTravis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# This script will build the project.

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew -Prelease.useLastTag=true build
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
# ./gradlew -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" build snapshot --stacktrace
./gradlew -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" build --stacktrace
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" final --stacktrace
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew -Prelease.useLastTag=true build
fi

0 comments on commit 485b1b0

Please sign in to comment.