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") diff --git a/lib/carp_study_app.dart b/lib/carp_study_app.dart index ee9f2430..a2ab6be4 100644 --- a/lib/carp_study_app.dart +++ b/lib/carp_study_app.dart @@ -36,8 +36,9 @@ class CarpStudyAppState extends State { GoRoute( path: '/', parentNavigatorKey: _shellNavigatorKey, - redirect: (context, state) => - bloc.hasInformedConsentBeenAccepted ? '/tasks' : '/consent', + redirect: (context, state) => !CarpService().authenticated + ? '/login' + : (bloc.hasInformedConsentBeenAccepted ? '/tasks' : '/consent'), ), GoRoute( path: '/tasks', @@ -103,8 +104,9 @@ class CarpStudyAppState extends State { GoRoute( path: '/consent', parentNavigatorKey: _rootNavigatorKey, - redirect: (context, state) => - bloc.studyId == null ? '/invitations' : null, + redirect: (context, state) => bloc.hasInformedConsentBeenAccepted + ? '/tasks' + : (bloc.studyId == null ? '/invitations' : null), builder: (context, state) => InformedConsentPage( bloc.data.informedConsentViewModel, ), @@ -116,6 +118,7 @@ class CarpStudyAppState extends State { GoRoute( path: '/login', parentNavigatorKey: _rootNavigatorKey, + redirect: (context, state) => CarpService().authenticated ? '/' : null, builder: (context, state) => LoginPage( bloc.data.loginPageViewModel, ), @@ -136,7 +139,9 @@ class CarpStudyAppState extends State { GoRoute( path: '/invitations', parentNavigatorKey: _rootNavigatorKey, - redirect: (context, state) => bloc.user == null ? '/login' : null, + redirect: (context, state) => bloc.studyId != null + ? '/consent' + : (bloc.user == null ? '/login' : null), builder: (context, state) => InvitationListPage(bloc.data.invitationsListViewModel), ),