Skip to content

Commit

Permalink
testing android release
Browse files Browse the repository at this point in the history
  • Loading branch information
j-roskopf committed Nov 20, 2023
1 parent c217238 commit 02cde18
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 14 deletions.
35 changes: 27 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release

on:
push:
tags:
branches:
- 'release/[0-9]+.[0-9]+.[0-9]+'

permissions:
Expand Down Expand Up @@ -39,9 +39,10 @@ jobs:
run: ./gradlew detektAll

android:
needs: [code-style]
runs-on: ubuntu-latest
timeout-minutes: 60
env:
GOOGLE_PLAY_API_CREDENTIALS: ${{ secrets.GOOGLE_PLAY_API_CREDENTIALS }}

steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
Expand All @@ -59,18 +60,36 @@ jobs:
with:
cache-disabled: true

- name: Build Android App
run: |
./gradlew \
:androidApp:bundle \
:androidApp:build
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1
with:
fileName: 'keystore/keystore.jks'
encodedString: ${{ secrets.KEYSTORE }}

- name: build prod
run: ./gradlew :androidApp:bundleRelease
env:
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}

- name: create-json
id: create-json
uses: jsdaniell/create-json@v1.2.2
with:
name: "sync_sphere_google_play_api_credentials.json"
json: ${{ secrets.GOOGLE_PLAY_API_CREDENTIALS }}

- name: upload to play store
run: bundle exec fastlane supply --aab androidApp/build/outputs/bundle/release/androidApp-release.aab

- name: Upload build outputs
if: always()
uses: actions/upload-artifact@v3
with:
name: android-build-outputs
path: androidApp/build/outputs/apk/
path: androidApp/build/outputs/

ios:
needs: [ code-style ]
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,14 @@ iOS and Android are already configured for debug.
```groovy
systemProp.syncSphereDebug=true
```

## TODO
- android publishing on CI
- last visited rooms UI



Account ID: 8141364126117566836
syncsphere-android-publishing@syncsphere-37dca.iam.gserviceaccount.com

openssl base64 < mncs_keystore.jks | tr -d '\n' | tee keystore.txt
9 changes: 9 additions & 0 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ android {
versionName = findProperty("android.versionName") as String
}

signingConfigs {
create("release") {
storePassword = System.getenv("SIGNING_STORE_PASSWORD")
keyPassword = System.getenv("SIGNING_KEY_PASSWORD")
storeFile = file("keystore/keystore.jks")
keyAlias = System.getenv("SIGNING_KEY_ALIAS")
}
}

compileOptions {
sourceCompatibility = JavaVersion.toVersion(libs.versions.jdk.get())
targetCompatibility = JavaVersion.toVersion(libs.versions.jdk.get())
Expand Down
7 changes: 6 additions & 1 deletion fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
team_name "Joseph Roskopf"
team_id "LVCF4PVSY3"
itc_team_id "126727947"
itc_team_name "Joseph Roskopf"
itc_team_name "Joseph Roskopf"

json_key_file("sync_sphere_google_play_api_credentials.json")
package_name("com.joetr.sync.sphere")

#fastlane supply --aab path/to/app.aab
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class RoomConstants(private val buildConfig: BuildConfig) {
}
}
}

interface BuildConfig {
fun isDebug(): Boolean
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,8 @@ class PreRoomScreen : Screen {
)
},
validateRoomCode = {
val (name, isAnonymous) = if (nameText.value.isNotEmpty()) {
Pair(nameText.value, false)
} else {
Pair(screenModel.getAnonymousUsername(), true)
val name = nameText.value.ifEmpty {
screenModel.getAnonymousUsername()
}

screenModel.validateRoomCode(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.joetr.sync.sphere.data

actual class BuildConfigImpl() : BuildConfig {

override fun isDebug(): Boolean {
val debugSystemProperty = System.getProperty("syncSphereDebug")
return debugSystemProperty?.toBoolean() ?: false
Expand Down

0 comments on commit 02cde18

Please sign in to comment.