signing config & build apk

This commit is contained in:
austinried 2023-04-28 10:19:38 +09:00
parent f0f812e66a
commit 49b8d2c423
3 changed files with 27 additions and 9 deletions

View File

@ -6,10 +6,11 @@ on:
- v2 - v2
jobs: jobs:
build-android: build-apk:
runs-on: ubuntu-latest runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
flutter-version: '3.7.11' flutter-version: '3.7.11'
@ -17,7 +18,6 @@ jobs:
cache: true cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:'
- run: flutter doctor
# - run: flutter pub get - run: flutter pub get
# - run: flutter build apk - run: flutter build apk
# - run: flutter build appbundle

1
.gitignore vendored
View File

@ -46,3 +46,4 @@ app.*.map.json
/.env /.env
*.sqlite* *.sqlite*
/.fvm/flutter_sdk /.fvm/flutter_sdk
*.keystore

View File

@ -25,6 +25,12 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android { android {
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion ndkVersion flutter.ndkVersion
@ -53,11 +59,22 @@ android {
versionName flutterVersionName versionName flutterVersionName
} }
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes { buildTypes {
release { release {
// TODO: Add your own signing config for the release build. if (project.hasProperty("signRelease")) {
// Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.release
signingConfig signingConfigs.debug } else {
signingConfig signingConfigs.debug
}
} }
} }
} }