Skip to content

Commit 3cd5bbe

Browse files
committed
feat: app sign [noPing]
1 parent ee1fb28 commit 3cd5bbe

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

.github/workflows/dart.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@ jobs:
5555
flutter-version: 3.24.1
5656
cache: true
5757

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+
5876
# Configure Gradle for faster builds
5977
- name: Configure Gradle
6078
run: |
@@ -65,7 +83,7 @@ jobs:
6583
6684
# Optimize Flutter build
6785
- run: flutter pub get
68-
- run: flutter build apk --release --split-debug-info --shrink
86+
- run: flutter build apk --release
6987

7088
- name: Rename APK
7189
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/Dantotsu_Android_${{github.ref_name}}.apk

android/app/build.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ android {
4747
versionCode = flutterVersionCode.toInteger()
4848
versionName = flutterVersionName
4949
}
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+
}
5063

5164
buildTypes {
5265
release {
@@ -55,7 +68,7 @@ android {
5568
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
5669
// TODO: Add your own signing config for the release build.
5770
// Signing with the debug keys for now, so `flutter run --release` works.
58-
signingConfig = signingConfigs.debug
71+
signingConfig = signingConfigs.release
5972
}
6073
}
6174
dependencies {

0 commit comments

Comments
 (0)