Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Travis with Firebase App Distribution #11

Merged
merged 2 commits into from
Nov 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
language: android
dist: trusty

before_install:
- openssl aes-256-cbc -K $encrypted_a039e732823a_key -iv $encrypted_a039e732823a_iv -in travis/secrets.tar.enc -out travis/secrets.tar -d
- tar xvf travis/secrets.tar
- cp travis/google-services.json app/google-services.json
- cp travis/home-assistant-mobile-apps-5fd6b9dd0fdb.json serviceCredentialsFile.json

android:
components:
- android-29
- build-tools-28.0.3

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/

cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache

script:
- echo $TRAVIS_COMMIT_MESSAGE > CHANGES.md
- export VERSION_CODE=`git rev-list --count HEAD`
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bash ./gradlew testReleaseUnitTest; fi'
- 'if [ "$TRAVIS_BRANCH" = "master" ]; then bash ./gradlew assembleRelease appDistributionUploadRelease; fi'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# :iphone: Home Assistant Companion for Android
# :iphone: Home Assistant Companion for Android [![Build Status](https://travis-ci.com/home-assistant/home-assistant-android.svg?branch=master)](https://travis-ci.com/home-assistant/home-assistant-android)
20 changes: 18 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.firebase.appdistribution'

buildscript {
repositories {
google()
}
dependencies {
classpath 'com.google.firebase:firebase-appdistribution-gradle:1.1.0'
}
}

android {
compileSdkVersion 29
Expand All @@ -9,9 +18,14 @@ android {
applicationId "io.homeassistant.android"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionCode "${System.env.VERSION_CODE ?: 1}".toInteger()
versionName "1.0.0"
}

firebaseAppDistribution {
serviceCredentialsFile = "serviceCredentialsFile.json"
releaseNotesFile = "CHANGES.md"
}
}

dependencies {
Expand All @@ -23,3 +37,5 @@ dependencies {
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'
implementation "com.squareup.retrofit2:converter-jackson:2.6.2"
}

apply plugin: 'com.google.gms.google-services'
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.2'
}
}

Expand Down
Binary file added travis/secrets.tar.enc
Binary file not shown.