feat: add keystore decoding and signing configuration for release builds

This commit is contained in:
Dr-Blank 2024-09-23 01:09:45 -04:00
parent c032595fc1
commit d25d23a0b7
No known key found for this signature in database
GPG key ID: 7452CC63F210A266
3 changed files with 29 additions and 2 deletions

View file

@ -18,6 +18,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Decode android/upload.jks
run: echo "${{ secrets.UPLOAD_KEYSTORE_JKS }}" | base64 --decode > android/upload.jks
- name: Decode android/key.properties
run: echo "${{ secrets.KEY_PROPERTIES }}" | base64 --decode > android/key.properties
- name: Checkout shelfsdk
uses: actions/checkout@v3
with:

View file

@ -14,6 +14,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Decode android/upload.jks
run: echo "${{ secrets.UPLOAD_KEYSTORE_JKS }}" | base64 --decode > android/upload.jks
- name: Decode android/key.properties
run: echo "${{ secrets.KEY_PROPERTIES }}" | base64 --decode > android/key.properties
- name: Checkout shelfsdk
uses: actions/checkout@v3
with:

View file

@ -22,6 +22,12 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
namespace "dr.blank.vaani"
compileSdk flutter.compileSdkVersion
@ -51,11 +57,20 @@ android {
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias = keystoreProperties['keyAlias']
keyPassword = keystoreProperties['keyPassword']
storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword = keystoreProperties['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.debug
// signingConfig signingConfigs.debug
signingConfig = signingConfigs.release
}
}
}