Skip to content

Commit

Permalink
Enable publishing the Wear OS to Beta. (#1772)
Browse files Browse the repository at this point in the history
* Enable publishing the Wear OS to Beta.

* Make versionCode different for wear app.
  • Loading branch information
zarakarlsson628 committed Oct 14, 2021
1 parent 2a316af commit e85f8db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .github/actions/create-release-number/action.yml
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly.yaml
Expand Up @@ -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"
10 changes: 9 additions & 1 deletion wear/build.gradle.kts
Expand Up @@ -2,6 +2,7 @@ plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-kapt")
id("com.github.triplet.play")
}

android {
Expand All @@ -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 {
Expand Down Expand Up @@ -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"))

Expand Down

0 comments on commit e85f8db

Please sign in to comment.