From 5f4e9545a9d83245c304b8924f5757a64cf8c245 Mon Sep 17 00:00:00 2001 From: Valentin REVERSAT Date: Sun, 25 Jun 2023 18:33:44 +0200 Subject: [PATCH] fix: CI & default env value --- .github/workflows/default.yaml | 3 ++- .github/workflows/dev.yaml | 3 ++- .github/workflows/flutter.build.action.yaml | 4 ++++ lib/const.dart | 1 + lib/main.dart | 3 ++- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/default.yaml b/.github/workflows/default.yaml index 64fa60eb..caeba20e 100644 --- a/.github/workflows/default.yaml +++ b/.github/workflows/default.yaml @@ -19,5 +19,6 @@ jobs: with: flutter_version: '3.10.0' android_output: 'apk' + env: 'dev' secrets: - passphrase: ${{ secrets.PASSPHRASE }} \ No newline at end of file + passphrase: ${{ secrets.PASSPHRASE }} diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index c9465037..34c8434e 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -20,6 +20,7 @@ jobs: with: flutter_version: '3.10.0' android_output: 'aab' + env: 'dev' secrets: passphrase: ${{ secrets.PASSPHRASE }} fastlane-dry-run: @@ -28,4 +29,4 @@ jobs: with: lane: 'dry_run' secrets: - passphrase: ${{ secrets.PASSPHRASE }} \ No newline at end of file + passphrase: ${{ secrets.PASSPHRASE }} diff --git a/.github/workflows/flutter.build.action.yaml b/.github/workflows/flutter.build.action.yaml index 88b9bac5..818e15b3 100644 --- a/.github/workflows/flutter.build.action.yaml +++ b/.github/workflows/flutter.build.action.yaml @@ -11,6 +11,10 @@ on: description: 'Android build file type output (apk or abb)' required: true type: string + env: + description: 'Environment in which the application will be build' + required: true + type: string secrets: passphrase: description: 'The passphrase to decrypt the configuration' diff --git a/lib/const.dart b/lib/const.dart index e8217019..4c9bb094 100644 --- a/lib/const.dart +++ b/lib/const.dart @@ -149,4 +149,5 @@ class Const { static const String specialWineFestivalBoatsEvent = 'Bateaux fete du vin'; static const String sentryDSNEnvKey = 'SENTRY_DSN'; static const String envKey = 'ENV'; + static const String defaultEnv = 'dev'; } diff --git a/lib/main.dart b/lib/main.dart index 44fe15a2..fbf4b84f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -44,7 +44,8 @@ void main() async { .toLowerCase(); /// Fetch running env - const env = String.fromEnvironment(Const.envKey, defaultValue: 'dev'); + const env = + String.fromEnvironment(Const.envKey, defaultValue: Const.defaultEnv); developer.log( '##### HI ! Starting $formattedRelease in $env mode #####',