From 60a56f871795494c52e264f61c5485f8a7c024eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Uek=C3=B6tter?= Date: Tue, 27 Aug 2024 19:48:21 +0200 Subject: [PATCH] release config --- .github/workflows/build_app.yaml | 34 +++++++++++++------------------- app/android/app/build.gradle | 9 +++++++++ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_app.yaml b/.github/workflows/build_app.yaml index b10513d..3a7dd44 100644 --- a/.github/workflows/build_app.yaml +++ b/.github/workflows/build_app.yaml @@ -32,27 +32,21 @@ jobs: with: channel: 'stable' flutter-version-file: app/pubspec.yaml - # write key.properties - #- run: echo "$KEY_PROPERTIES" > android/key.properties - # env: - # KEY_PROPERTIES: ${{ secrets.key_properties }} - # write key.keystore - #- run: mkdir android/key - #- run: echo "$KEY_KEYSTORE" | base64 --decode > android/key/key.keystore - # env: - # KEY_KEYSTORE: ${{ secrets.key_keystore }} - run: flutter pub get - run: flutter analyze . - #- run: flutter build apk --build-number $GITHUB_RUN_NUMBER - - run: flutter build apk --build-number ${{ inputs.buildNumber }} --build-name ${{ inputs.versionName }} - - name: Create Release - id: create_release - uses: softprops/action-gh-release@v2 + - name: Decode Keystore env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ENCODED_KEYSTORE: ${{ secrets.KEYSTORE_BASE64 }} + DECODED_KEYSTORE_PATH: android/app/keystore.jks + run: | + echo $ENCODED_KEYSTORE > keystore_base64.txt + base64 -d keystore_base64.txt > $DECODED_KEYSTORE_PATH + #- run: flutter build apk --build-number $GITHUB_RUN_NUMBER + - run: flutter build aab --build-number ${{ inputs.buildNumber }} --build-name ${{ inputs.versionName }} + - name: Upload to Google Play + uses: r0adkll/upload-google-play@v1 with: - name: App Release ${{ inputs.versionName }}-${{ inputs.buildNumber }} - tag_name: app-${{ inputs.buildNumber }} - draft: false - prerelease: true - files: ./app/build/app/outputs/apk/release/app-release.apk \ No newline at end of file + serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} + packageName: dev.uekoetter.passkit + releaseFiles: ./app/build/app/outputs/aab/release/app-release.aab + track: production \ No newline at end of file diff --git a/app/android/app/build.gradle b/app/android/app/build.gradle index a638390..ead7316 100644 --- a/app/android/app/build.gradle +++ b/app/android/app/build.gradle @@ -51,6 +51,15 @@ android { versionName flutterVersionName } + signingConfigs { + release { + storeFile file("keystore.jks") + storePassword System.getenv("KEYSTORE_PASSWORD") + keyAlias "cards_keystore" + keyPassword System.getenv("KEY_PASSWORD") + } + } + buildTypes { release { signingConfig signingConfigs.debug