Skip to content

Commit

Permalink
Try to build sample app in release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
AmniX committed Oct 21, 2024
1 parent 699d7fa commit 266f060
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 27 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,28 @@ jobs:
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
# - name: Deploy
# uses: gradle/gradle-build-action@v3
# with:
# arguments: ${{ matrix.target }} --no-configuration-cache --no-daemon
# env:
# ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
# ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
# ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MEMORY_KEY }}
# ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
# SDK_VERSION: ${GITHUB_REF_NAME#v}
- name: Deploy
uses: gradle/gradle-build-action@v3
with:
arguments: ${{ matrix.target }} --no-configuration-cache --no-daemon
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MEMORY_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
SDK_VERSION: ${GITHUB_REF_NAME#v}
- name: Setup local.properties
run: touch local.properties && echo "TEST_SERVER_URL=$TEST_SERVER_URL" >> local.properties
- name: Build SoundBud!
run: ./gradlew :example-android:assembleDevRelease
- name: Publish SoundBud!
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: example-android/build/outputs/apk/dev/release/example-android-dev-release.apk
asset_name: SoundBud-v$VERSION.apk
tag: $VERSION
make_latest: false
env:
VERSION: ${GITHUB_REF_NAME#v}
1 change: 1 addition & 0 deletions android/consumer-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-keep class com.komoju.mobile.sdk.remote.dtos.** { *; }
6 changes: 4 additions & 2 deletions example-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ android {
minSdk = 24
targetSdk = 35
versionCode = 1
versionName = "1.0"
versionName = System.getenv("VERSION") ?: "1.0"
resValue("string", "komoju_consumer_app_scheme", "komapp")
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
signingConfig = signingConfigs.getByName("debug")
}

buildTypes {
release {
isMinifyEnabled = false
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
Expand Down
4 changes: 3 additions & 1 deletion example-android/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

-keep class com.komoju.android.ui.remote.dtos.** { *; }
1 change: 0 additions & 1 deletion example-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/Theme.FakeShopApp">
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.komoju.android.ui.screens.store

import cafe.adriel.voyager.core.model.ScreenModel
import cafe.adriel.voyager.core.model.screenModelScope
import com.komoju.android.BuildConfig
import com.komoju.android.sdk.ExperimentalKomojuPaymentApi
import com.komoju.android.sdk.KomojuSDK
import com.komoju.android.sdk.types.Currency
Expand Down Expand Up @@ -45,9 +46,10 @@ class FakeStoreScreenModel : ScreenModel {
remoteApiService.getPublishableKey().body()?.publishableKey
}.onSuccess { publishableKey ->
if (publishableKey == null) {
_uiState.update { it.copy(error = "Failed to fetch publishable key.") }
_uiState.update { it.copy(error = "Failed to fetch publishable key from Server ${BuildConfig.SERVER_URL}") }
}
}.onFailure { error ->
error.printStackTrace()
_uiState.update { it.copy(error = "Failed to fetch publishable key.\n${error.message}") }
}.getOrNull()

Expand Down
12 changes: 0 additions & 12 deletions example-android/src/main/res/xml/network_security_config.xml

This file was deleted.

0 comments on commit 266f060

Please sign in to comment.