Enable publishing the Wear OS to Beta. (#1772)

* Enable publishing the Wear OS to Beta.

* Make versionCode different for wear app.
This commit is contained in:
Justin Bassett 2021-10-13 22:42:23 -04:00 committed by GitHub
parent 51df8dd9a8
commit 8fbc55e97b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

View file

@ -21,9 +21,7 @@ runs:
run: |
COMMITS=`git rev-list --count HEAD`
TAGS=`git tag | grep -v beta | wc -l`
# Because for a while we were increasing by 2 rather than one we need an offset
OFFSET=15
VC=$((COMMITS+TAGS+OFFSET))
VC=$(((COMMITS+TAGS) << 1))
HASH=`git rev-parse --short HEAD`
if [ "${{inputs.beta}}" = "true" ]; then
VERSION=beta-$VC-$HASH

View file

@ -75,4 +75,4 @@ jobs:
KEYSTORE_ALIAS_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_ALIAS_PASSWORD }}
VERSION: ${{ steps.rel_number.outputs.version }}
VERSION_CODE: ${{ steps.rel_number.outputs.version-code }}
run: ./gradlew publishFullReleaseBundle || echo "Issue uploading Release, may just be nothing has changed"
run: ./gradlew :app:publishFullReleaseBundle :wear:publishReleaseBundle || echo "Issue uploading Release, may just be nothing has changed"

View file

@ -2,6 +2,7 @@ plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-kapt")
id("com.github.triplet.play")
}
android {
@ -13,7 +14,8 @@ android {
targetSdk = 30
versionName = System.getenv("VERSION") ?: "LOCAL"
versionCode = System.getenv("VERSION_CODE")?.toIntOrNull() ?: 1
// We add 1 because the app and wear versions need to have different version codes.
versionCode = (System.getenv("VERSION_CODE")?.toIntOrNull() ?: 1) + 1
javaCompileOptions {
annotationProcessorOptions {
@ -62,6 +64,12 @@ android {
}
}
play {
serviceAccountCredentials.set(file("playStorePublishServiceCredentialsFile.json"))
track.set("beta")
resolutionStrategy.set(com.github.triplet.gradle.androidpublisher.ResolutionStrategy.IGNORE)
}
dependencies {
implementation(project(":common"))