High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(CI): fix mobile build artifact with proper signing (#1504)
Alex4f38851880f8
diff --git a/.github/workflows/build-mobile.yml b/.github/workflows/build-mobile.ymlindex a8e29f632a..071c89e6da 100644--- a/.github/workflows/build-mobile.yml+++ b/.github/workflows/build-mobile.yml@@ -7,50 +7,47 @@ on:push:branches: [main]-jobs:build-sign-android:name: Build and sign Android- runs-on: ubuntu-latest-+ runs-on: macos-12+steps:- uses: actions/checkout@v3- uses: actions/setup-java@v3with:- distribution: 'zulu'+ distribution: "zulu"java-version: "12.x"- cache: 'gradle'+ cache: "gradle"- name: Setup Flutter SDKuses: subosito/flutter-action@v2with:- channel: 'stable'- flutter-version: '3.3.10'+ channel: "stable"+ flutter-version: "3.3.10"cache: true- name: Create the Keystore-env:- KEYSTORE_BASE64: ${{ secrets.ANDROID_SIGN_KEY_CONTENT }}- run: |- # import keystore from secrets- echo $KEYSTORE_BASE64 | base64 -d > $RUNNER_TEMP/my_production.keystore+ KEY_JKS: ${{ secrets.KEY_JKS }}+ working-directory: ./mobile+ run: echo $KEY_JKS | base64 -d > android/key.jks- - name: Restore packages+ - name: Get Packagesworking-directory: ./mobilerun: flutter pub get- name: Build Android App Bundleworking-directory: ./mobile+ env:+ ALIAS: ${{ secrets.ALIAS }}+ ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}+ ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}run: flutter build apk --release- - name: Sign Android App Bundle- working-directory: ./mobile- run: jarsigner -keystore $RUNNER_TEMP/my_production.keystore -storepass ${{ secrets.ANDROID_KEY_PASSWORD }} -keypass ${{ secrets.ANDROID_STORE_PASSWORD }} -sigalg SHA256withRSA -digestalg SHA-256 -signedjar build/app/outputs/apk/release/app-release-signed.apk build/app/outputs/apk/release/*.apk ${{ secrets.ALIAS }}-- name: Publish Android Artifactuses: actions/upload-artifact@v3with:name: release-apk-signed- path: mobile/build/app/outputs/apk/release/app-release-signed.apk\ No newline at end of file+ path: mobile/build/app/outputs/flutter-apk/app-release.apkdiff --git a/.gitignore b/.gitignoreindex 32ef7ed927..83e90831d3 100644--- a/.gitignore+++ b/.gitignore@@ -8,4 +8,5 @@ uploadscoveragemobile/gradle.properties-mobile/openapi/pubspec.lock\ No newline at end of file+mobile/openapi/pubspec.lock+mobile/*.jksdiff --git a/mobile/android/app/build.gradle b/mobile/android/app/build.gradleindex da8ed20712..3d3435a2a5 100644--- a/mobile/android/app/build.gradle+++ b/mobile/android/app/build.gradle@@ -57,21 +57,22 @@ android {versionName flutterVersionName}- // signingConfigs {- // release {- // keyAlias keystoreProperties['keyAlias']- // keyPassword keystoreProperties['keyPassword']- // storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null- // storePassword keystoreProperties['storePassword']- // }- // }+ signingConfigs {+ release {+ def keyAliasVal = System.getenv("ALIAS")+ def keyPasswordVal = System.getenv("ANDROID_KEY_PASSWORD")+ def storePasswordVal = System.getenv("ANDROID_STORE_PASSWORD")++ keyAlias keyAliasVal ? keyAliasVal : keystoreProperties['keyAlias']+ keyPassword keyPasswordVal ? keyPasswordVal : keystoreProperties['keyPassword']+ storeFile file("../key.jks") ? file("../key.jks") : file(keystoreProperties['storeFile'])+ storePassword storePasswordVal ? storePasswordVal : 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.release- signingConfig null+ signingConfig signingConfigs.release}}}