Fix apk signing issue

This commit is contained in:
John Wesley 2024-01-11 20:26:27 -05:00
parent 92e83a4eaa
commit da60dd8c87
3 changed files with 35 additions and 5 deletions

View File

@ -27,9 +27,12 @@ jobs:
draft: true draft: true
create-build: create-build:
needs: draft-release
environment: production
name: Create ${{ matrix.target }} build name: Create ${{ matrix.target }} build
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false
matrix: matrix:
target: [android, linux, windows] target: [android, linux, windows]
include: include:
@ -48,8 +51,6 @@ jobs:
build_target: windows build_target: windows
build_path: build\windows\x64\runner\Release build_path: build\windows\x64\runner\Release
asset_extension: .zip asset_extension: .zip
fail-fast: false
needs: draft-release
steps: steps:
- name: Install Android dependencies - name: Install Android dependencies
if: matrix.target == 'android' if: matrix.target == 'android'
@ -78,6 +79,18 @@ jobs:
dart pub global activate cider dart pub global activate cider
cider version ${{ github.event.inputs.version }} 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 - name: Build Flutter app
run: | run: |
dart run build_runner build dart run build_runner build

View File

@ -22,6 +22,12 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0' flutterVersionName = '1.0'
} }
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android { android {
namespace "one.jwr.interstellar" namespace "one.jwr.interstellar"
compileSdkVersion flutter.compileSdkVersion compileSdkVersion flutter.compileSdkVersion
@ -50,13 +56,24 @@ 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 (keystorePropertiesFile.exists()) {
// Signing with the debug keys for now, so `flutter run --release` works. signingConfig signingConfigs.release
} else {
signingConfig signingConfigs.debug signingConfig signingConfigs.debug
} }
} }
}
} }
flutter { flutter {