Skip to content

Commit

Permalink
aggiunti file per travis
Browse files Browse the repository at this point in the history
  • Loading branch information
therickys93 committed Sep 20, 2017
1 parent 79f2907 commit 82795fc
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
sudo: false
language: android
jdk: oraclejdk8
android:
components:
- platform-tools
- tools
- build-tools-25.0.2
- android-23
before_install:
- chmod +x gradlew
- echo y | android update sdk --no-ui --all --filter "tool,extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository"
- echo y | $ANDROID_HOME/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"
script:
- ./gradlew clean assembleRelease
after_success:
- sh set_tags.sh
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.m2
- $HOME/.gradle
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
19 changes: 19 additions & 0 deletions set_tags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
BRANCH="master"

if [ "$TRAVIS_BRANCH" = "$BRANCH" ]; then
if [ "$TRAVIS_PULL_REQUEST" = false ]; then
if [ -z "$TRAVIS_TAG" ]; then
echo -e "Starting to tag commit.\n"

git config --global user.email "[email protected]"
git config --global user.name "Travis"

# Add tag and push to master.
git tag -a v1.0.${TRAVIS_BUILD_NUMBER} -m "Travis build $TRAVIS_BUILD_NUMBER pushed a tag."
git push origin --tags
git fetch origin

echo -e "Done magic with tags.\n"
fi
fi
fi

0 comments on commit 82795fc

Please sign in to comment.