Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
632c0a4a87 | ||
|
|
4bb18d128f | ||
|
|
9cd8ac1783 |
No files matched your search
@@ -133,6 +133,52 @@ 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" }
|
||||
|
||||
@(
|
||||
"storePassword=$storePass",
|
||||
"keyPassword=$keyPass",
|
||||
"keyAlias=$alias",
|
||||
"storeFile=tis_rms_release.keystore"
|
||||
) | Set-Content -Path "key.properties" -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
|
||||
# ------------------------------------------------------------
|
||||
|
||||
@@ -46,3 +46,4 @@ app.*.map.json
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
/android/app/google-services.json
|
||||
/android/key.properties
|
||||
@@ -12,3 +12,4 @@ GeneratedPluginRegistrant.java
|
||||
key.properties
|
||||
**/*.keystore
|
||||
**/*.jks
|
||||
KEYSTORE_BASE64.txt
|
||||
@@ -1,3 +1,6 @@
|
||||
import java.io.FileInputStream
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("com.google.gms.google-services")
|
||||
@@ -5,6 +8,12 @@ plugins {
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
val keystorePropertiesFile = rootProject.file("key.properties")
|
||||
val keystoreProperties = Properties()
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.teamsb.tis_rms"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
@@ -31,11 +40,22 @@ android {
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
keyAlias = keystoreProperties.getProperty("keyAlias")
|
||||
keyPassword = keystoreProperties.getProperty("keyPassword")
|
||||
storeFile = keystoreProperties.getProperty("storeFile")?.let { file(it) }
|
||||
storePassword = keystoreProperties.getProperty("storePassword")
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
signingConfig = if (keystorePropertiesFile.exists()) {
|
||||
signingConfigs.getByName("release")
|
||||
} else {
|
||||
signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
storePassword=android
|
||||
keyPassword=android
|
||||
keyAlias=androiddebugkey
|
||||
storeFile=tis_rms_release.keystore
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user