From 1bddb8d1b6bfb17d9319026e0c7342165775f705 Mon Sep 17 00:00:00 2001 From: Mathias Mogensen <42929161+Xazin@users.noreply.github.com> Date: Wed, 1 Mar 2023 09:14:19 +0100 Subject: [PATCH] ci: if-condition on signing step --- .github/workflows/ci.yml | 1 + .../utils/firebase_crashlytics_extension.dart | 21 +++++++++++++++++++ .../profile/widget/commitments_tab.dart | 12 +++++------ 3 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 lib/core/utils/firebase_crashlytics_extension.dart diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6791942f..91dcc330 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -167,6 +167,7 @@ jobs: cp release_notes.txt build/app/outputs/ - name: Sign appbundle + if: ${{ github.ref == 'refs/heads/master' }} uses: r0adkll/sign-android-release@v1 id: sign_appbundle with: diff --git a/lib/core/utils/firebase_crashlytics_extension.dart b/lib/core/utils/firebase_crashlytics_extension.dart new file mode 100644 index 00000000..4136d5d4 --- /dev/null +++ b/lib/core/utils/firebase_crashlytics_extension.dart @@ -0,0 +1,21 @@ +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; + +extension FirebaseCrashlyticsLogger on FirebaseCrashlytics { + static Future log(String message) async { + FirebaseCrashlytics.instance.log(message); + } + + static Future warn( + Exception exception, + StackTrace? stackTrace, { + String? message, + bool fatal = true, + }) async { + FirebaseCrashlytics.instance.recordError( + exception, + stackTrace, + reason: message, + fatal: fatal, + ); + } +} diff --git a/lib/presentation/profile/widget/commitments_tab.dart b/lib/presentation/profile/widget/commitments_tab.dart index 39eb9ced..8cfebc0f 100644 --- a/lib/presentation/profile/widget/commitments_tab.dart +++ b/lib/presentation/profile/widget/commitments_tab.dart @@ -70,12 +70,12 @@ class CommitmentsTab extends StatelessWidget { ), ), ), - if (user == null || (crowdActions?.isEmpty ?? false)) ...[ - SignUpCTA( - user: user, - title: 'View your amazing commitments here', - ), - ], + ], + if (user == null || (crowdActions?.isEmpty ?? false)) ...[ + SignUpCTA( + user: user, + title: 'View your amazing commitments here', + ), ], ], ),