Skip to content

Commit

Permalink
build(ci): Sign release app and update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
realth000 committed Dec 15, 2023
1 parent 67f7f0b commit 268a9e2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
name: Build Linux and Android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
Expand All @@ -27,16 +27,19 @@ jobs:
- run: flutter pub get
- run: dart run build_runner build
- run: flutter build linux
- name: Setup Android sign key
run: |
echo '${{ secrets.KEYSTORE }}' | base64 --decode > android/app/key.jks
echo '${{ secrets.KEY_PROPERTIES }}' > android/key.properties
- run: flutter build apk
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{env.CI_FLUTTER_VERSION}}
cache: true
- run: flutter pub get
- run: dart run build_runner build
- run: flutter build windows
18 changes: 17 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
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 {
compileSdkVersion 34
ndkVersion flutter.ndkVersion
Expand Down Expand Up @@ -56,6 +63,15 @@ android {
versionName flutterVersionName
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}

buildTypes {
debug {
ndk {
Expand All @@ -66,7 +82,7 @@ android {
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
signingConfig signingConfigs.release
ndk {
// abiFilters "arm64-v8a", "armeabi-v7a"
abiFilters "arm64-v8a"
Expand Down

0 comments on commit 268a9e2

Please sign in to comment.