Fix apk signing issue
This commit is contained in:
parent
92e83a4eaa
commit
da60dd8c87
|
@ -27,9 +27,12 @@ jobs:
|
|||
draft: true
|
||||
|
||||
create-build:
|
||||
needs: draft-release
|
||||
environment: production
|
||||
name: Create ${{ matrix.target }} build
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: [android, linux, windows]
|
||||
include:
|
||||
|
@ -48,8 +51,6 @@ jobs:
|
|||
build_target: windows
|
||||
build_path: build\windows\x64\runner\Release
|
||||
asset_extension: .zip
|
||||
fail-fast: false
|
||||
needs: draft-release
|
||||
steps:
|
||||
- name: Install Android dependencies
|
||||
if: matrix.target == 'android'
|
||||
|
@ -78,6 +79,18 @@ jobs:
|
|||
dart pub global activate cider
|
||||
cider version ${{ github.event.inputs.version }}
|
||||
|
||||
- name: Configure Keystore
|
||||
run: |
|
||||
echo "$ANDROID_UPLOAD_KEY" | base64 --decode > upload-keystore.jks
|
||||
echo "storeFile=../upload-keystore.jks" >> key.properties
|
||||
echo "keyAlias=upload" >> key.properties
|
||||
echo "storePassword=$ANDROID_KEYSTORE_PASSWORD" >> key.properties
|
||||
echo "keyPassword=$ANDROID_KEYSTORE_PASSWORD" >> key.properties
|
||||
env:
|
||||
ANDROID_UPLOAD_KEY: ${{ secrets.ANDROID_UPLOAD_KEY }}
|
||||
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
||||
working-directory: android
|
||||
|
||||
- name: Build Flutter app
|
||||
run: |
|
||||
dart run build_runner build
|
||||
|
|
|
@ -22,6 +22,12 @@ if (flutterVersionName == null) {
|
|||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
def keystorePropertiesFile = rootProject.file('key.properties')
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
android {
|
||||
namespace "one.jwr.interstellar"
|
||||
compileSdkVersion flutter.compileSdkVersion
|
||||
|
@ -50,11 +56,22 @@ android {
|
|||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
keyAlias keystoreProperties['keyAlias']
|
||||
keyPassword keystoreProperties['keyPassword']
|
||||
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
|
||||
storePassword keystoreProperties['storePassword']
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig signingConfigs.debug
|
||||
if (keystorePropertiesFile.exists()) {
|
||||
signingConfig signingConfigs.release
|
||||
} else {
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue