From 4bb18d128f10ca4f48a4c7c670cee4d3d9650a01 Mon Sep 17 00:00:00 2001 From: ssbg04 Date: Thu, 17 Sep 2026 13:14:59 +0800 Subject: [PATCH] ci: restore android release keystore from secrets and bump version to 1.0.13+13 --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++ frontend/android/.gitignore | 1 + frontend/android/key.properties.example | 8 ++--- frontend/pubspec.yaml | 2 +- 4 files changed, 53 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3965f30..c98b71f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -133,6 +133,53 @@ jobs: Write-Host "google-services.json restored." + # ------------------------------------------------------------ + # Android Release Keystore & Signing Configuration + # ------------------------------------------------------------ + - name: Restore Android Release Keystore from Secret + env: + ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} + if: ${{ env.ANDROID_KEYSTORE_BASE64 != '' }} + working-directory: frontend/android/app + shell: pwsh + run: | + $ErrorActionPreference = 'Stop' + + $base64 = $env:ANDROID_KEYSTORE_BASE64.Trim() + $bytes = [Convert]::FromBase64String($base64) + [IO.File]::WriteAllBytes("$PWD/tis_rms_release.keystore", $bytes) + + Write-Host "tis_rms_release.keystore successfully restored from secret." + + - name: Configure Android key.properties + env: + KEY_STORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_STORE_PASSWORD }} + KEY_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_KEY_PASSWORD }} + KEY_ALIAS: ${{ secrets.ANDROID_KEYSTORE_KEY_ALIAS }} + working-directory: frontend/android + shell: pwsh + run: | + $ErrorActionPreference = 'Stop' + + $keystoreFile = "app/tis_rms_release.keystore" + if (Test-Path $keystoreFile) { + $storePass = if ($env:KEY_STORE_PASSWORD) { $env:KEY_STORE_PASSWORD } else { "android" } + $keyPass = if ($env:KEY_PASSWORD) { $env:KEY_PASSWORD } else { "android" } + $alias = if ($env:KEY_ALIAS) { $env:KEY_ALIAS } else { "androiddebugkey" } + + $keyPropertiesContent = @" +storePassword=$storePass +keyPassword=$keyPass +keyAlias=$alias +storeFile=tis_rms_release.keystore +"@ + Set-Content -Path "key.properties" -Value $keyPropertiesContent -Encoding ascii + Write-Host "Android key.properties successfully created." + } else { + Write-Warning "Keystore file not found at $keystoreFile. Build will use debug signing." + } + + # ------------------------------------------------------------ # Determine Release Tag & Version # ------------------------------------------------------------ diff --git a/frontend/android/.gitignore b/frontend/android/.gitignore index be3943c..e532c9e 100644 --- a/frontend/android/.gitignore +++ b/frontend/android/.gitignore @@ -12,3 +12,4 @@ GeneratedPluginRegistrant.java key.properties **/*.keystore **/*.jks +KEYSTORE_BASE64.txt diff --git a/frontend/android/key.properties.example b/frontend/android/key.properties.example index c5d4abe..bcd6ae0 100644 --- a/frontend/android/key.properties.example +++ b/frontend/android/key.properties.example @@ -1,4 +1,4 @@ -storePassword=tis_rms_2026 -keyPassword=tis_rms_2026 -keyAlias=upload -storeFile=upload-keystore.jks +storePassword=android +keyPassword=android +keyAlias=androiddebugkey +storeFile=tis_rms_release.keystore diff --git a/frontend/pubspec.yaml b/frontend/pubspec.yaml index 4defbfb..1ee3966 100644 --- a/frontend/pubspec.yaml +++ b/frontend/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.1+2 +version: 1.0.13+13 environment: sdk: ^3.11.5