diff --git a/.travis/script.sh b/.travis/script.sh old mode 100644 new mode 100755 index 6ed79b05c..c10f13d2f --- a/.travis/script.sh +++ b/.travis/script.sh @@ -2,9 +2,11 @@ set -ev -echo `git log --format=%B -n 1 $TRAVIS_COMMIT` > CHANGES.md +git log --format=%B -n 1 $TRAVIS_COMMIT > CHANGES.md +mkdir -p app/src/main/play/release-notes/en-US/ +cp CHANGES.md app/src/main/play/release-notes/en-US/default.txt + export VERSION_CODE=`git rev-list --count HEAD` -export VERSION_NAME=`git describe --tags $(git rev-list --tags --max-count=1)` ./gradlew test ./gradlew lint @@ -14,9 +16,9 @@ if [ "$TRAVIS_PULL_REQUEST" = "false" ] then if [ -n "$TRAVIS_TAG" ] then - ./gradlew publishReleaseBundle + echo "Release already in Play Store Console" elif [ "$TRAVIS_BRANCH" = "master" ] then - ./gradlew assembleRelease appDistributionUploadRelease + ./gradlew assembleRelease appDistributionUploadRelease publishReleaseBundle fi fi \ No newline at end of file diff --git a/README.md b/README.md index e84c4e86f..3dcd8ebd7 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ If you get stuck while setting up your own environment, you can ask questions in ## Testing Dev Releases -We are using [Travis](https://travis-ci.com/home-assistant/home-assistant-android) to perform continuous integration both by unit testing, deploying dev releases to [Firebase App Distribution](https://appdistribution.firebase.dev/i/8zf5W4zz) and final releases to the [Play Store](https://play.google.com/store/apps/details?id=io.homeassistant.companion.android) when we add a git tag. +We are using [Travis](https://travis-ci.com/home-assistant/home-assistant-android) to perform continuous integration both by unit testing, deploying dev releases to [Play Store Beta](https://play.google.com/apps/testing/io.homeassistant.companion.android) and final releases to the [Play Store](https://play.google.com/store/apps/details?id=io.homeassistant.companion.android) when we release. ## Quality @@ -48,3 +48,14 @@ To run a check with an auto-format: ## Translating The project currently uses [lokalise](https://lokalise.com/public/145814835dd655bc5ab0d0.36753359/) to translate the application. If you are interested in helping translate go the the link and click start translating! + + +## Generating a release to production +Edit the build number in `/app/build.gradle` to your desired version. Be sure to leave `${vCode}`!! + +```kotlin +def vName = "X.X.X-${vCode}" +``` +Merge that into master and allow the build to complete and validate on the beta channel. (Deploy there automatic) + +Once ready to move to production log into play store -> Release Management -> App Releases -> Beta -> Promote to Production diff --git a/app/build.gradle b/app/build.gradle index cecac343c..83a5f1717 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,6 +19,9 @@ buildscript { } } +def vCode = "${System.env.VERSION_CODE ?: 1}".toInteger() +def vName = "1.7.1-${vCode}" + android { compileSdkVersion projectSdkVersion.toInteger() @@ -26,8 +29,8 @@ android { applicationId "io.homeassistant.companion.android" minSdkVersion projectMinSdkVersion targetSdkVersion 29 - versionCode "${System.env.VERSION_CODE ?: 1}".toInteger() - versionName "${System.env.VERSION_NAME ?: "1.0.0"}" + versionCode vCode + versionName vName } firebaseAppDistribution { @@ -77,6 +80,7 @@ android { play { serviceAccountCredentials = file("playStorePublishServiceCredentialsFile.json") + track = "beta" } dependencies {