File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 55
55
flutter-version : 3.24.1
56
56
cache : true
57
57
58
+ # Download the keystore file (from GitHub Secrets or other storage)
59
+ - name : Download keystore
60
+ env :
61
+ KEYSTORE_BASE64 : ${{ secrets.APK_SIGN }}
62
+ run : echo "$KEYSTORE_BASE64" | base64 --decode > android/app/dartotsu.jks
63
+
64
+ # Set up environment variables for signing
65
+ - name : Set up signing variables
66
+ env :
67
+ KEYSTORE_PASSWORD : ${{ secrets.KEYSTORE_PASSWORD }}
68
+ KEY_PASSWORD : ${{ secrets.KEYSTORE_PASSWORD }}
69
+ KEY_ALIAS : ${{ secrets.KEY_ALIAS}}
70
+ run : |
71
+ echo "storePassword=$KEYSTORE_PASSWORD" > android/key.properties
72
+ echo "keyPassword=$KEY_PASSWORD" >> android/key.properties
73
+ echo "keyAlias=$KEY_ALIAS" >> android/key.properties
74
+ echo "storeFile=dartotsu.jks" >> android/key.properties
75
+
58
76
# Configure Gradle for faster builds
59
77
- name : Configure Gradle
60
78
run : |
65
83
66
84
# Optimize Flutter build
67
85
- run : flutter pub get
68
- - run : flutter build apk --release --split-debug-info --shrink
86
+ - run : flutter build apk --release
69
87
70
88
- name : Rename APK
71
89
run : mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/Dantotsu_Android_${{github.ref_name}}.apk
Original file line number Diff line number Diff line change @@ -47,6 +47,19 @@ android {
47
47
versionCode = flutterVersionCode. toInteger()
48
48
versionName = flutterVersionName
49
49
}
50
+ signingConfigs {
51
+ release {
52
+ def keystoreProperties = new Properties ()
53
+ def keystorePropertiesFile = rootProject. file(' key.properties' )
54
+ if (keystorePropertiesFile. exists()) {
55
+ keystoreProperties. load(new FileInputStream (keystorePropertiesFile))
56
+ }
57
+ keyAlias keystoreProperties[' keyAlias' ]
58
+ keyPassword keystoreProperties[' keyPassword' ]
59
+ storeFile keystoreProperties[' storeFile' ] ? file(keystoreProperties[' storeFile' ]) : null
60
+ storePassword keystoreProperties[' storePassword' ]
61
+ }
62
+ }
50
63
51
64
buildTypes {
52
65
release {
@@ -55,7 +68,7 @@ android {
55
68
proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
56
69
// TODO: Add your own signing config for the release build.
57
70
// Signing with the debug keys for now, so `flutter run --release` works.
58
- signingConfig = signingConfigs. debug
71
+ signingConfig = signingConfigs. release
59
72
}
60
73
}
61
74
dependencies {
You can’t perform that action at this time.
0 commit comments