Skip to content

Commit

Permalink
1.2.0-SNAPSHOT and enable SNAPSHOT auto deploy (#277)
Browse files Browse the repository at this point in the history
I copied this from the work Mike Nakhimovich did to enable this for Lottie.
  • Loading branch information
gpeal committed Sep 4, 2019
1 parent 1569c86 commit 3dea645
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 29 deletions.
55 changes: 27 additions & 28 deletions .travis.yml
@@ -1,41 +1,40 @@
language: android

android:
components:
- tools
- platform-tools
- build-tools-28.0.2
- build-tools-28.0.3
- android-28
- extra-google-google_play_services
- extra-android-m2repository
- extra-android-support
- extra-google-m2repository

- tools
- platform-tools
- build-tools-28.0.2
- build-tools-28.0.3
- android-28
- extra-google-google_play_services
- extra-android-m2repository
- extra-android-support
- extra-google-m2repository
jdk:
- oraclejdk8

- oraclejdk8
branches:
except:
- gh-pages

- gh-pages
notifications:
email: false

after_success:
- ./deploy_snapshot.sh
jobs:
include:
- stage: format
name: Detekt
script: "./detekt"
- stage: test
name: Lint
script: "./gradlew lintRelease"
- name: Unit Tests
script: "./gradlew testReleaseUnitTest"

- stage: format
name: Detekt
script: "./detekt"
- stage: test
name: Lint
script: "./gradlew lintRelease"
- name: Unit Tests
script: "./gradlew testReleaseUnitTest"
sudo: false

cache:
directories:
- $HOME/.m2
- $HOME/.gradle
- "$HOME/.m2"
- "$HOME/.gradle"
env:
global:
- secure: pkJDHQWy/5GuSd0tEneEF2RO9Wl6jN2rXRF7+K5NBFE214fk9bLnz0+0f3NoU6XaZnXOjH5QwuKX6k7stPmZZNVc1eKU0NsGbd5QYNTJ4AG179nX215U6Z8A7epMy16+TnA4Etqb3j675Bg8eW77J2YWqJ26yu4tTGXWA+JJnu9MzGFep43Sgw025zqvQfwrOVCanJzXR5b+DUd0PpV0RrcUifhoFPhK6MqQZanHliBzPVnsbJW9yxMWEOA4zN+fTQkxwf6tyZGodnvyWkndM5nQ6bMW3YPi5hNQldPKGekJruk5m01Bv+V3IR24LxbC78DBwYMupdSQNnTHRmWUBh29/CBh7GjYs1+kP0BcRGsT1mVhQRaa1NfA7Jtv3P9sSvrF819l9Sf0oCo+22b/d+aHxDv0+kqtq9pRorhpu12xhXSDsVDQW+FUXVWzr0ZmNu35IvSswAwLjxARhupH7fn6cEQYHWNmHDSj4NGxErRICbSfHAUhWMQAHYIprsSBC0CgE1wgtr3FJ6XYiTNwN/cFzCPRrkXegAA4pEA+o0eNSCWcWEuc+ssEwfowqn278bi02BpX30kBoB6dAqedigxYKFsnTthobHqiyiMLEZJHECuePpcGOtIv0HW03b+bMw6YH6KNNAlQdvRWWpRPMNrfn8TlJB5VOavdxTadsGs=
- secure: HcMCZS9b8xzllRt6bVU7GwPZGgZr9UmG9ib1sGwXLBpVHCBZC0OXoiIwZxJuc+AdvcbW0Ntxz2UanyL+uRy8dqgLO2U5T0Ej4Tra0fSS2gnkA2G9hB+5jr841txW8jAygn7LcjWwyg3B8upAuBYtIQgKq0GfDvP8es8NQ85VKFGDd1LFH6tZ6vVVTToVHevI92Qaj39FPhFyBhRFKKdpqhP1vEkqIIllU1uzrmsmG1IwAiq5oe82YbOArt54oAzAe1/qQ1mLDttLR03aTdqUa024i5R2YzWxg/BeeSC8b+9EFdpF4wntIyeKr5digPaxKAcEERqv4RL5CaOLFZ0vZt7bpLROEBiNWExLaJXv7l8rdANbb33c3J1+1n4U4fJA3ht4150Lm912Bdh83utdgBVUj+PfthmZ7tnfZj1jFgh2rfv99gASqpqnFtyLE+gnqvgoN0NtZ5yS/95l9h+4PpTO6p/O0FyVLB/or0FAV9wKbRBBLjU3yhfPf65SRGY+EHFhJqMByH45f2BOv9+hUlkMnWiHU9OrqwlBZa9z+yMao9FarVJUfmBC7HuXt7/66Tyb6+8TtiuIZ61Co1yUDTCsdtYENRyjQe5nq9RLSpaxHTAi6E8xZL+p7blak+r/444UGQh8X+A05y0ZSd0qjldXJbCggV9odURl0v2WL64=
27 changes: 27 additions & 0 deletions deploy_snapshot.sh
@@ -0,0 +1,27 @@

#!/bin/bash
#
# Deploy a jar, source jar, and javadoc jar to Sonatype's snapshot repo.
#
# Adapted from https://coderwall.com/p/9b_lfq and
# http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/

SLUG="airbnb/mvrx"
JDK="oraclejdk8"
BRANCH="master"

set -e

if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then
echo "Skipping snapshot deployment: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'."
elif [ "$TRAVIS_JDK_VERSION" != "$JDK" ]; then
echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$TRAVIS_JDK_VERSION'."
elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "Skipping snapshot deployment: was pull request."
elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then
echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'."
else
echo "Deploying snapshot..."
./gradlew -no-daemon --no-parallel mvrx:uploadArchives testing:uploadArchives -PSONATYPE_USERNAME="${SONATYPE_USERNAME}" -PSONATYPE_PASSWORD="${SONATYPE_PASSWORD}"
echo "Snapshot deployed!"
fi
2 changes: 1 addition & 1 deletion gradle.properties
@@ -1,4 +1,4 @@
VERSION_NAME=1.1.0
VERSION_NAME=1.2.0-SNAPSHOT
GROUP=com.airbnb.android

POM_DESCRIPTION=MvRx is an Android application framework that makes product development fast and fun.
Expand Down

0 comments on commit 3dea645

Please sign in to comment.