Sign release apks (#123)

This commit is contained in:
Marcin Wojnarowski 2021-01-30 14:40:43 +01:00 committed by GitHub
parent 71290a5f78
commit b8787730e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 22 deletions

View File

@ -35,12 +35,27 @@ jobs:
- name: Run lints - name: Run lints
run: flutter analyze run: flutter analyze
- name: Run dartfmt - name: Check formatting
run: dartfmt --dry-run --set-exit-if-changed . run: flutter format --dry-run --set-exit-if-changed .
- name: Run tests - name: Run tests
run: flutter test run: flutter test
- name: Inject keystore
working-directory: android
env:
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
ALIAS: ${{ secrets.ALIAS }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: |
echo storePassword=$KEY_STORE_PASSWORD > key.properties
echo keyPassword=$KEY_PASSWORD >> key.properties
echo keyAlias=$ALIAS >> key.properties
echo storeFile=$HOME/key.jks >> key.properties
echo $SIGNING_KEY | base64 -d | tee ~/key.jks >/dev/null
- name: Android build - name: Android build
run: flutter build apk --split-per-abi run: flutter build apk --split-per-abi

View File

@ -25,8 +25,14 @@ 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 28 compileSdkVersion 30
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
@ -37,21 +43,27 @@ android {
} }
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.krawieck.lemmur"
applicationId "com.example.lemmur"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 28 targetSdkVersion 30
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
buildTypes { signingConfigs {
release { release {
// TODO: Add your own signing config for the release build. keyAlias keystoreProperties['keyAlias']
// Signing with the debug keys for now, so `flutter run --release` works. keyPassword keystoreProperties['keyPassword']
signingConfig signingConfigs.debug storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
} storePassword keystoreProperties['storePassword']
} }
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
} }
flutter { flutter {

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lemmur"> package="com.krawieck.lemmur">
<!-- Flutter needs it to communicate with the running application <!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lemmur"> package="com.krawieck.lemmur">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that <!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method. calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide In most cases you can leave this as-is, but you if you want to provide

View File

@ -1,4 +1,4 @@
package com.example.lemmur package com.krawieck.lemmur
import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterActivity

View File

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lemmur"> package="com.krawieck.lemmur">
<!-- Flutter needs it to communicate with the running application <!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->

View File

@ -378,7 +378,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.lemmur; PRODUCT_BUNDLE_IDENTIFIER = com.krawieck.lemmur;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@ -515,7 +515,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.lemmur; PRODUCT_BUNDLE_IDENTIFIER = com.krawieck.lemmur;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -546,7 +546,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.example.lemmur; PRODUCT_BUNDLE_IDENTIFIER = com.krawieck.lemmur;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
project(runner LANGUAGES CXX) project(runner LANGUAGES CXX)
set(BINARY_NAME "lemmur") set(BINARY_NAME "lemmur")
set(APPLICATION_ID "com.example.lemmur") set(APPLICATION_ID "com.krawieck.lemmur")
cmake_policy(SET CMP0063 NEW) cmake_policy(SET CMP0063 NEW)