Skip to content

Commit 624bffb

Browse files
committed
Test: App with Signed build
1 parent b378b80 commit 624bffb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+83
-176573
lines changed

.github/workflows/main.yaml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,50 @@ on:
99
- flutter_app
1010
workflow_dispatch:
1111

12-
jobs:
12+
jobs:
1313
build:
1414
name: Build & Release
1515
runs-on: ubuntu-latest
1616

1717
steps:
1818
- name: Checkout Repository
1919
uses: actions/checkout@v4
20-
20+
2121
- name: Set Gradle Java Home
2222
run: sed -i '$d' android/gradle.properties
2323

2424
- name: Set Up Java
2525
uses: actions/setup-java@v3
2626
with:
27-
distribution: 'oracle'
28-
java-version: '17'
27+
distribution: "oracle"
28+
java-version: "17"
2929
cache: gradle
3030

3131
- name: Set Up Flutter
3232
uses: subosito/flutter-action@v2
3333
with:
34-
flutter-version: '3.27.2'
35-
channel: 'stable'
36-
cache: true
34+
flutter-version: "3.27.2"
35+
channel: "stable"
36+
cache: true
37+
38+
- name: Decode Keystore
39+
run: |
40+
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/upload-keystore.jks
41+
ls -l android/
42+
43+
- name: Create key.properties
44+
run: |
45+
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" > android/key.properties
46+
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
47+
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
48+
echo "storeFile=upload-keystore.jks" >> android/key.properties
49+
cat android/key.properties
3750
3851
- name: Install Dependencies
3952
run: flutter pub get
4053

4154
- name: Build APK
42-
run: flutter build apk
55+
run: flutter build apk --release
4356

4457
- name: Upload APK
4558
uses: actions/upload-artifact@v4

android/app/build.gradle

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
plugins {
22
id "com.android.application"
3-
// START: FlutterFire Configuration
4-
id 'com.google.gms.google-services'
5-
// END: FlutterFire Configuration
3+
id "com.google.gms.google-services" // FlutterFire
64
id "kotlin-android"
7-
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
85
id "dev.flutter.flutter-gradle-plugin"
96
}
107

8+
def keystoreProperties = new Properties()
9+
def keystorePropertiesFile = rootProject.file('key.properties')
10+
if (keystorePropertiesFile.exists()) {
11+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
12+
}
13+
1114
android {
1215
namespace = "com.example.mujslcm"
1316
compileSdk = flutter.compileSdkVersion
@@ -23,21 +26,32 @@ android {
2326
}
2427

2528
defaultConfig {
26-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
2729
applicationId = "com.example.mujslcm"
28-
// You can update the following values to match your application needs.
29-
// For more information, see: https://flutter.dev/to/review-gradle-config.
3030
minSdk = flutter.minSdkVersion
3131
targetSdk = flutter.targetSdkVersion
3232
versionCode = flutter.versionCode
3333
versionName = flutter.versionName
3434
}
3535

36+
signingConfigs {
37+
release {
38+
if (keystorePropertiesFile.exists()) {
39+
keyAlias keystoreProperties['keyAlias']
40+
keyPassword keystoreProperties['keyPassword']
41+
storeFile rootProject.file("android/${keystoreProperties['storeFile']}")
42+
storePassword keystoreProperties['storePassword']
43+
}
44+
}
45+
}
46+
3647
buildTypes {
3748
release {
38-
// TODO: Add your own signing config for the release build.
39-
// Signing with the debug keys for now, so `flutter run --release` works.
40-
signingConfig = signingConfigs.debug
49+
if (keystorePropertiesFile.exists()) {
50+
signingConfig signingConfigs.release
51+
}
52+
minifyEnabled true
53+
shrinkResources true
54+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
4155
}
4256
}
4357
}

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true
4-
org.gradle.java.home=C\:/Program Files/Java/jdk-17
4+
org.gradle.java.home=/usr/lib/jvm/java-17-openjdk

build/web/.last_build_id

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/web/assets/AssetManifest.bin

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/web/assets/AssetManifest.bin.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/web/assets/AssetManifest.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/web/assets/FontManifest.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)