diff --git a/.github/workflows/branch_name_check_action.yaml b/.github/workflows/branch_name_check_action.yaml index 9e50991..d8bec0f 100644 --- a/.github/workflows/branch_name_check_action.yaml +++ b/.github/workflows/branch_name_check_action.yaml @@ -24,4 +24,4 @@ jobs: branch-name: "${{ github.head_ref }}" validation-logic: "equalTo('feature/ECOM-*/**') || equalTo('bugfix/ECOM-*/**') || equalTo('hotfix/ECOM-*/**') || equalTo('release/ECOM-*/**')" trim-from-start: "" - fail-when-not-valid: true + fail-when-not-valid: true \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..1e075e5 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,44 @@ +name: Deploy Flutter App to Firebase App Distribution (Android) + +on: + pull_request: + types: + - opened + - edited + - synchronize + - reopened + +jobs: + build: + runs-on: ubuntu-latest # Use the latest version of Ubuntu for the build environment + + steps: + - name: Checkout repository + uses: actions/checkout@v4 # Check out the repository to the runner + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: stable + flutter-version: 3.35.2 + + - name: Install dependencies + run: flutter pub get # Install Flutter dependencies defined in pubspec.yaml + + - name: Create google-services.json + env: + DATA: ${{secrets.GOOGLE_SERVICES_JSON}} # Your base64-encoded secret + run: | + mkdir -p android/app + echo "$DATA" | base64 -di > android/app/google-services.json + + - name: Build APK for Android + run: flutter build apk --release # Build the release APK for Android + + - name: Deploy to Firebase App Distribution + uses: wzieba/Firebase-Distribution-Github-Action@v1 # Use Firebase Distribution GitHub Action to deploy + with: + appId: ${{secrets.ANDROID_FIREBASE_APP_ID}} # Firebase App ID for Android + serviceCredentialsFileContent: ${{secrets.SERVICE_ACCOUNT_KEY}} # Firebase service account key for authentication + groups: testers # Distribution group(s) to receive the app + file: build/app/outputs/flutter-apk/app-release.apk # Path to the built APK file \ No newline at end of file diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 2c5f259..2417985 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -1,5 +1,8 @@ plugins { id("com.android.application") + // START: FlutterFire Configuration + id("com.google.gms.google-services") + // END: FlutterFire Configuration id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index ab39a10..bd7522f 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -19,6 +19,9 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" id("com.android.application") version "8.7.3" apply false + // START: FlutterFire Configuration + id("com.google.gms.google-services") version("4.3.15") apply false + // END: FlutterFire Configuration id("org.jetbrains.kotlin.android") version "2.1.0" apply false } diff --git a/firebase.json b/firebase.json new file mode 100644 index 0000000..4905d68 --- /dev/null +++ b/firebase.json @@ -0,0 +1 @@ +{"flutter":{"platforms":{"android":{"default":{"projectId":"test-889b8","appId":"1:367071902570:android:b277909430f1077d214313","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"test-889b8","configurations":{"android":"1:367071902570:android:b277909430f1077d214313","ios":"1:367071902570:ios:86452325bd1b6639214313"}}}}}} \ No newline at end of file diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart new file mode 100644 index 0000000..d77049d --- /dev/null +++ b/lib/firebase_options.dart @@ -0,0 +1,68 @@ +// File generated by FlutterFire CLI. +// ignore_for_file: type=lint +import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; +import 'package:flutter/foundation.dart' + show defaultTargetPlatform, kIsWeb, TargetPlatform; + +/// Default [FirebaseOptions] for use with your Firebase apps. +/// +/// Example: +/// ```dart +/// import 'firebase_options.dart'; +/// // ... +/// await Firebase.initializeApp( +/// options: DefaultFirebaseOptions.currentPlatform, +/// ); +/// ``` +class DefaultFirebaseOptions { + static FirebaseOptions get currentPlatform { + if (kIsWeb) { + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for web - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + } + switch (defaultTargetPlatform) { + case TargetPlatform.android: + return android; + case TargetPlatform.iOS: + return ios; + case TargetPlatform.macOS: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for macos - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.windows: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for windows - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + case TargetPlatform.linux: + throw UnsupportedError( + 'DefaultFirebaseOptions have not been configured for linux - ' + 'you can reconfigure this by running the FlutterFire CLI again.', + ); + default: + throw UnsupportedError( + 'DefaultFirebaseOptions are not supported for this platform.', + ); + } + } + + static const FirebaseOptions android = FirebaseOptions( + apiKey: 'AIzaSyCl6VoMYf4_2Pk_fF2pR0PCBwxtvFCb5SU', + appId: '1:367071902570:android:b277909430f1077d214313', + messagingSenderId: '367071902570', + projectId: 'test-889b8', + storageBucket: 'test-889b8.firebasestorage.app', + ); + + static const FirebaseOptions ios = FirebaseOptions( + apiKey: 'AIzaSyDm_tW2TgzGyVC1vjGuVY154h_5nCG-t4k', + appId: '1:367071902570:ios:86452325bd1b6639214313', + messagingSenderId: '367071902570', + projectId: 'test-889b8', + storageBucket: 'test-889b8.firebasestorage.app', + iosBundleId: 'com.example.githubActions', + ); +} diff --git a/pubspec.lock b/pubspec.lock index d4bc197..1e64a2f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -74,7 +74,7 @@ packages: source: hosted version: "3.0.2" build_runner: - dependency: "direct main" + dependency: "direct dev" description: name: build_runner sha256: fd3c09f4bbff7fa6e8d8ef688a0b2e8a6384e6483a25af0dac75fef362bcfe6f @@ -193,6 +193,30 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "967dae9a65f69377beb9f4ab292ea63ce5befa1ce24682cab1b69ca4b7a46927" + url: "https://pub.dev" + source: hosted + version: "4.1.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: "5dbc900677dcbe5873d22ad7fbd64b047750124f1f9b7ebe2a33b9ddccc838eb" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: f7ee08febc1c4451588ce58ffcf28edaee857e9a196fee88b85deb889990094a + url: "https://pub.dev" + source: hosted + version: "3.1.0" fixnum: dependency: transitive description: @@ -219,6 +243,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" frontend_server_client: dependency: transitive description: @@ -268,37 +297,45 @@ packages: source: hosted version: "1.0.5" json_annotation: - dependency: transitive + dependency: "direct main" description: name: json_annotation sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" url: "https://pub.dev" source: hosted version: "4.9.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: "33a040668b31b320aafa4822b7b1e177e163fc3c1e835c6750319d4ab23aa6fe" + url: "https://pub.dev" + source: hosted + version: "6.11.1" leak_tracker: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: @@ -363,6 +400,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.1" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" pool: dependency: transitive description: @@ -408,6 +453,22 @@ packages: description: flutter source: sdk version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: ccf30b0c9fbcd79d8b6f5bfac23199fb354938436f62475e14aea0f29ee0f800 + url: "https://pub.dev" + source: hosted + version: "4.0.1" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "6a3c6cc82073a8797f8c4dc4572146114a39652851c157db37e964d9c7038723" + url: "https://pub.dev" + source: hosted + version: "1.3.8" source_span: dependency: transitive description: @@ -460,10 +521,10 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.6" timing: dependency: transitive description: @@ -484,10 +545,10 @@ packages: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: @@ -538,4 +599,4 @@ packages: version: "3.1.3" sdks: dart: ">=3.8.1 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + flutter: ">=3.22.0" diff --git a/pubspec.yaml b/pubspec.yaml index d78f367..1b27377 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,6 +35,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.8 json_annotation: ^4.9.0 + firebase_core: ^4.1.0 dev_dependencies: flutter_test: diff --git a/test.text b/test.text new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/test.text @@ -0,0 +1 @@ +test