Skip to content

Commit

Permalink
Merge pull request #186 from ReactiveX/travis-build
Browse files Browse the repository at this point in the history
Support for Releasing via Travis to Bintray/Sonatype
  • Loading branch information
benjchristensen committed Jun 29, 2015
2 parents 4bff437 + b9bbe04 commit bb2f5db
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,31 @@ language: android

jdk:
- oraclejdk7
- oraclejdk8

android:
components:
- android-22
- build-tools-22.0.1

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

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

notifications:
email: false

sudo: false

# cache between builds
cache:
directories:
- $HOME/.gradle
- $HOME/.m2
- $HOME/.gradle

# credential for release
env:
global:
- secure: mQwFIdOIooeZ1KkDhkhXdSORA3Tn713C7SYYaF/ZWhhhINHvwMjPAOT+R7zSyGGqjhpqklRbKmZXDJHGPdus1q5CvZLYvldeQXsEfzvav95aukHjNbOIa3y/5h1rZWXwTLR13aMv/o87SrTT2xiyE6XgxFxN3eSsu/zavrQGQkM=
- secure: hKrGR9YZ2At9vktZRhmkwPK82u8wDHgHPWoxbIE629/oY7WbbRvsmVnXp5ontLd4RJJwnN1ujf2hlr/H7ZioUoIbln0qqX3e399IWLg5OhUdTJVpeAVCenVoNa53p/YCMeo/aE9JWK1oM4AXvIBt8vgZUpCPTfVgsbzF2BACfoY=
- secure: GJc0t6x9GdPO2EfMTCQP+UU1P9nvxsGkbrtvaNWocHP5BU/X3pcC1CEN6iiXsaYUrhYngOw7jMi3uPgKA8c+FRbnyqhkNubWY0WkChK4vrymjIkTPDMbLELVJoYLsJFZXY8+8wJLJa3D11ShcHAC3K68KGVBVlRqBBv2UidtFjY=
- secure: lC5Z9+kBmU3MWhmdjIJqQ8vS5QnTm7vepzDRAJH0K3apwaAUx/iZwrLa8XveA05XBim4jga+VHMHAVILilacvxK8T1L01JkYhhMC8ii3ye/HP5Pwy66dPdvl8VaS0vnC3DkB1i7JGv5h0Vx8RcWyJ77qpLjUFsW6db7/3x8pKpo=
16 changes: 16 additions & 0 deletions gradle/buildViaTravis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/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}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build snapshot --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}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" 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 bb2f5db

Please sign in to comment.