From 97c049e45365d60c2aaba98b45cbbbb12d9e79df Mon Sep 17 00:00:00 2001 From: bvandeusen Date: Thu, 12 Mar 2026 07:51:11 -0400 Subject: [PATCH 1/2] fix: guard release signingConfig behind key.properties existence check signingConfigs.create() was running unconditionally, casting null properties to String before the buildTypes guard could take effect. CI has no key.properties so the cast threw. Now falls back to debug signing when the keystore file is absent. --- android/app/build.gradle.kts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 1eeb08e..ac1073e 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -37,11 +37,13 @@ android { } signingConfigs { - create("release") { - keyAlias = keystoreProperties["keyAlias"] as String - keyPassword = keystoreProperties["keyPassword"] as String - storeFile = file(keystoreProperties["storeFile"] as String) - storePassword = keystoreProperties["storePassword"] as String + if (keystorePropertiesFile.exists()) { + create("release") { + keyAlias = keystoreProperties["keyAlias"] as String + keyPassword = keystoreProperties["keyPassword"] as String + storeFile = file(keystoreProperties["storeFile"] as String) + storePassword = keystoreProperties["storePassword"] as String + } } } From baba5c3462409e5bb23ad63d9e2c717e0d33399a Mon Sep 17 00:00:00 2001 From: bvandeusen Date: Thu, 12 Mar 2026 07:52:26 -0400 Subject: [PATCH 2/2] feat: inject version from release tag at build time pubspec.yaml now holds a placeholder (0.0.0+0) that is never updated. CI strips the v* tag to derive --build-name (e.g. 26.03.12) and --build-number (e.g. 260312) and passes them to flutter build apk. --- .forgejo/workflows/ci.yml | 9 ++++++++- pubspec.yaml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index ce8e06b..465dbda 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -55,7 +55,14 @@ jobs: run: flutter pub get - name: Build release APK - run: flutter build apk --release + run: | + # Derive version from the tag (e.g. v26.03.12 → name=26.03.12 number=260312) + TAG="${{ github.ref_name }}" + BUILD_NAME="${TAG#v}" + BUILD_NUMBER=$(echo "$BUILD_NAME" | tr -d '.') + flutter build apk --release \ + --build-name="$BUILD_NAME" \ + --build-number="$BUILD_NUMBER" - name: Set artifact name id: artifact diff --git a/pubspec.yaml b/pubspec.yaml index e13a650..299298d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: fabled_app description: "FabledAssistant mobile client for Android." publish_to: 'none' -version: 26.03.12+1 +version: 0.0.0+0 # overridden at build time via --build-name / --build-number environment: sdk: ^3.11.0