Skip to content

Commit 9dc302c

Browse files
committed
feat: enhance APK build process and update README with release information
1 parent f8e315e commit 9dc302c

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/create-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363

6464
- name: Build debug APK
6565
if: ${{ steps.detect.outputs.exists == 'true' }}
66-
run: ./gradlew :waltid-applications:waltid-wallet-demo-compose:androidApp:assembleDebug --no-daemon --console=plain --warning-mode=summary
66+
run: ./gradlew :waltid-applications:waltid-wallet-demo-compose:androidApp:assembleDebug -PappVersionName=${{ inputs.version }} --no-daemon --console=plain --warning-mode=summary
6767
env:
6868
CI: "true"
6969
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}

waltid-applications/waltid-wallet-demo-compose/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ Android builds can override it with `-PtransactionDataProfiles.url=...`. Compose
5050
- Web/Wasm is currently a mock UI preview wired to `createMockDemoWallet()`. It does not exercise the mobile wallet SDK, platform key storage, SQLDelight persistence, EUDI flows, or Enterprise flows.
5151
- Production web wallet support is expected to live outside this mobile demo app. If a shared web UI is needed later, the shared UI module may need to move or split around the final web architecture.
5252

53+
## Release APK
54+
55+
Each GitHub release attaches a debug-signed `waltid-wallet-demo-compose-<version>.apk`, built with `assembleDebug`. Because CI signs with a fresh, throwaway debug key per release, a release APK **cannot upgrade a previously installed one** — uninstall the existing app first, then install the new one. Uninstalling resets local wallet data (see [Local wallet data](#local-wallet-data)).
56+
5357
## Common commands
5458

5559
Android and shared UI:

waltid-applications/waltid-wallet-demo-compose/androidApp/build.gradle.kts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ plugins {
88
val javaVersion = identityLibs.versions.java.library.get().toInt()
99
val publicDemoTransactionDataProfilesUrl = "https://wallet.demo.walt.id/wallet-api/transaction-data-profiles"
1010

11+
val appVersionName: String = (findProperty("appVersionName") as String?)?.takeIf { it.isNotBlank() } ?: "0.1.0"
12+
val appVersionCode: Int = run {
13+
val core = appVersionName.trimStart('v', 'V').substringBefore('-').substringBefore('+')
14+
val parts = core.split('.')
15+
fun slot(i: Int) = (parts.getOrNull(i)?.toIntOrNull() ?: 0).coerceIn(0, 999)
16+
(slot(0) * 1_000_000L + slot(1) * 1_000L + slot(2)).coerceIn(1L, 2_100_000_000L).toInt()
17+
}
18+
1119
android {
1220
namespace = "id.walt.walletdemo.compose.android"
1321
compileSdk = 37
@@ -16,8 +24,8 @@ android {
1624
applicationId = "id.walt.walletdemo.compose"
1725
minSdk = 30
1826
targetSdk = 37
19-
versionCode = 1
20-
versionName = "0.1.0"
27+
versionCode = appVersionCode
28+
versionName = appVersionName
2129
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2230

2331
buildConfigField("String", "ATTESTATION_BASE_URL", "\"${findProperty("attestation.baseUrl") ?: ""}\"")

0 commit comments

Comments
 (0)