From cb9d3d4127af9a974d80ebd40e02d43d10571caa Mon Sep 17 00:00:00 2001 From: Lars Refsgaard <1552887+LarsRefsgaard@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:22:05 +0200 Subject: [PATCH] Fix the build and release workflow for Android (#166) --- .github/workflows/deploy_play_store.yml | 10 +++++----- .github/workflows/deploy_play_store_beta.yml | 10 ++++++---- .github/workflows/deploy_play_store_prod.yml | 9 +++++---- .gitignore | 1 + android/app/build.gradle | 2 +- android/fastlane/Appfile | 2 +- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy_play_store.yml b/.github/workflows/deploy_play_store.yml index 96dea1c7..23ee8db6 100644 --- a/.github/workflows/deploy_play_store.yml +++ b/.github/workflows/deploy_play_store.yml @@ -53,7 +53,7 @@ jobs: - name: Setup Fastlane uses: ruby/setup-ruby@8a45918450651f5e4784b6031db26f4b9f76b251 # v1.150.0 with: - ruby-version: "2.6" + ruby-version: "head" bundler-cache: true working-directory: android @@ -61,10 +61,10 @@ jobs: run: | echo "$PLAY_STORE_UPLOAD_KEY" | base64 --decode > app/upload-keystore.jks echo "$PLAY_STORE_CONFIG_JSON" > PLAY_STORE_CONFIG.json - echo "storeFile=upload-keystore.jks" >> key.properties - echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties - echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> key.properties + echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties + echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties + echo "storeFile=upload-keystore.jks" >> key.properties env: PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }} KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }} @@ -77,5 +77,5 @@ jobs: - name: Deploy to Play Store run: bundle exec fastlane ${{ inputs.lane || 'beta' }} env: - PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }} + PLAY_STORE_JSON_KEY: ${{ secrets.PLAY_STORE_JSON_KEY }} working-directory: android \ No newline at end of file diff --git a/.github/workflows/deploy_play_store_beta.yml b/.github/workflows/deploy_play_store_beta.yml index 451a7b79..5a6a88ce 100644 --- a/.github/workflows/deploy_play_store_beta.yml +++ b/.github/workflows/deploy_play_store_beta.yml @@ -1,9 +1,10 @@ name: Deploy to Play Store beta on: - # Enable manual run push: - branches: - - 'master' + tags: + - '*' + workflow_dispatch: + # Declare default permissions as read only. @@ -11,6 +12,7 @@ permissions: read-all jobs: workflow_run: - uses: cph-cachet/carp-studies-app/.github/workflows/deploy_play_store.yml@master + uses: cph-cachet/carp-studies-app/.github/workflows/deploy_play_store.yml@LarsRefsgaard/issue163 + secrets: inherit with: lane: 'beta' diff --git a/.github/workflows/deploy_play_store_prod.yml b/.github/workflows/deploy_play_store_prod.yml index 76b44de3..8977f23d 100644 --- a/.github/workflows/deploy_play_store_prod.yml +++ b/.github/workflows/deploy_play_store_prod.yml @@ -1,9 +1,9 @@ name: Deploy to Play Store production on: - # Enable manual run - push: - tags: - - '*' + release: + types: + - released + workflow_dispatch: # Declare default permissions as read only. @@ -12,5 +12,6 @@ permissions: read-all jobs: workflow_run: uses: cph-cachet/carp-studies-app/.github/workflows/deploy_play_store.yml@master + secrets: inherit with: lane: 'promote_to_production' diff --git a/.gitignore b/.gitignore index df700fcf..ab19670a 100644 --- a/.gitignore +++ b/.gitignore @@ -116,3 +116,4 @@ app.*.map.json lib/blocs/credentials.dart carp/carpspec.yaml android/key.properties +android/fastlane/report.xml diff --git a/android/app/build.gradle b/android/app/build.gradle index e3a9001c..32e5b08f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -13,7 +13,7 @@ if (flutterRoot == null) { def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { - flutterVersionCode = '18' + flutterVersionCode = '19' } def flutterVersionName = localProperties.getProperty('flutter.versionName') diff --git a/android/fastlane/Appfile b/android/fastlane/Appfile index 6b6af08d..cc889957 100644 --- a/android/fastlane/Appfile +++ b/android/fastlane/Appfile @@ -1,2 +1,2 @@ package_name("dk.cachet.carp_study_app") # -json_key_file("PLAY_STORE_CONFIG.json") \ No newline at end of file +json_key_file("PLAY_STORE_CONFIG.json")