From 36ae1a48d6922d74bbb7f24f70824b0096bec5e4 Mon Sep 17 00:00:00 2001 From: Stadnik Andrii Date: Sun, 8 Oct 2023 15:39:39 +0300 Subject: [PATCH 1/4] feat(workspace): add workspace dependencies --- Cargo.lock | 1 - Cargo.toml | 6 ++++++ app/native/Cargo.toml | 3 +-- bot/Cargo.toml | 11 ++++++----- core/Cargo.toml | 9 ++++----- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f67481d8..aac13c52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -904,7 +904,6 @@ dependencies = [ name = "native" version = "0.1.0" dependencies = [ - "anyhow", "first_aid_bot_core", "flutter_rust_bridge", "openssl", diff --git a/Cargo.toml b/Cargo.toml index 94ea8ae7..a6df4a84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,3 +6,9 @@ members = [ "bot", "app/native" ] + +[workspace.dependencies] +log = "0.4" +tokio = { version = "1", features = ["rt-multi-thread", "macros"] } +anyhow = "1" +serde = "1" diff --git a/app/native/Cargo.toml b/app/native/Cargo.toml index bec9f777..7824b382 100644 --- a/app/native/Cargo.toml +++ b/app/native/Cargo.toml @@ -9,8 +9,7 @@ edition = "2021" crate-type = ["cdylib", "staticlib"] [dependencies] -tokio = "1" first_aid_bot_core = { path = "../../core" } -anyhow = "1" flutter_rust_bridge = "1" openssl = { version = "0.10", features = ["vendored"] } +tokio = { workspace = true } diff --git a/bot/Cargo.toml b/bot/Cargo.toml index 5823f753..48439224 100644 --- a/bot/Cargo.toml +++ b/bot/Cargo.toml @@ -7,14 +7,15 @@ edition = "2021" [dependencies] first_aid_bot_core = { path = "../core" } -tokio = { version = "1.32", features = ["rt-multi-thread", "macros"] } pretty_env_logger = "0.5" -log = "0.4" -serde = { version = "1.0" } -anyhow = "1.0" teloxide = { version = "0.12", features = ["macros", "redis-storage", - "bincode-serializer", "throttle"] } +"bincode-serializer", "throttle"] } redis = { version = "0.23", features = ["tokio-comp"] } rand = "0.8" itertools = "0.10" futures = "0.3" + +anyhow = { workspace = true } +tokio = { workspace = true } +log = { workspace = true } +serde = { workspace = true } diff --git a/core/Cargo.toml b/core/Cargo.toml index 19dff011..e53a63fe 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -13,14 +13,13 @@ crate-type = ["staticlib", "cdylib", "rlib"] # # Load the data csv = "1.2" bytes = "1.5" -serde = { version = "1.0", features = ["derive"] } reqwest = { version = "0.11"} indexmap = "1.9" +anyhow = { workspace = true } +tokio = { workspace = true } +log = { workspace = true } +serde = { workspace = true, features = ["derive"] } -# futures = "0.3" -log = "0.4" -anyhow = "1.0" -tokio = { version = "1.32" , features = ["macros", "rt-multi-thread" ] } const_format = "0.2" regex = "1.9.5" From 7ad86b6b4c3dcf315e3e87fcbd107bcefa3edd58 Mon Sep 17 00:00:00 2001 From: Stadnik Andrii Date: Sun, 8 Oct 2023 15:51:15 +0300 Subject: [PATCH 2/4] fix: Update SHEET_ID secret to use environment variable --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4eb20199..2f9144f4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,14 +19,14 @@ jobs: release: ${{ github.base_ref == 'main' }} upload-artifact: true secrets: - SHEET_ID: ${{ secrets.SHEET_ID }} + SHEET_ID: ${{ env.SHEET_ID }} build_flutter_apk: uses: ./.github/workflows/build_flutter_apk.yml with: upload-artifact: true secrets: - SHEET_ID: ${{ secrets.SHEET_ID }} + SHEET_ID: ${{ env.SHEET_ID }} # It should wait untill all checks will pass auto-merge: From e8870e7c0bab1a2e976618afcf20198823fce390 Mon Sep 17 00:00:00 2001 From: Stadnik Andrii Date: Sun, 8 Oct 2023 15:52:43 +0300 Subject: [PATCH 3/4] chore: Update environment variable name in CI workflow --- .github/workflows/CI.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2f9144f4..580d4a9f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,14 +19,14 @@ jobs: release: ${{ github.base_ref == 'main' }} upload-artifact: true secrets: - SHEET_ID: ${{ env.SHEET_ID }} + SHEET_ID: ${{ vars.SHEET_ID }} build_flutter_apk: uses: ./.github/workflows/build_flutter_apk.yml with: upload-artifact: true secrets: - SHEET_ID: ${{ env.SHEET_ID }} + SHEET_ID: ${{ vars.SHEET_ID }} # It should wait untill all checks will pass auto-merge: From dbed7714d0558bd572adc897d2c0bde872190f83 Mon Sep 17 00:00:00 2001 From: Stadnik Andrii Date: Sun, 8 Oct 2023 16:00:12 +0300 Subject: [PATCH 4/4] refactor: Remove unnecessary ABI targets in build.gradle --- app/android/app/build.gradle | 4 ++-- app/lib/bridge_definitions.dart | 2 +- app/lib/bridge_generated.dart | 2 +- app/lib/bridge_generated.io.dart | 2 +- app/lib/bridge_generated.web.dart | 2 +- app/native/src/bridge_generated.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/android/app/build.gradle b/app/android/app/build.gradle index bc376417..35d5f7cd 100644 --- a/app/android/app/build.gradle +++ b/app/android/app/build.gradle @@ -91,8 +91,8 @@ dependencies { '-t', 'arm64-v8a', // the below 2 ABIs are usually used for Android simulators, // add or remove these ABIs as needed. - '-t', 'x86', - '-t', 'x86_64', + // '-t', 'x86', + // '-t', 'x86_64', '-o', '../android/app/src/main/jniLibs', 'build' if (profileMode != null) { args profileMode diff --git a/app/lib/bridge_definitions.dart b/app/lib/bridge_definitions.dart index 77e6232a..e2d94b47 100644 --- a/app/lib/bridge_definitions.dart +++ b/app/lib/bridge_definitions.dart @@ -1,5 +1,5 @@ // AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.82.0. +// Generated by `flutter_rust_bridge`@ 1.82.1. // ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const import 'bridge_generated.io.dart' diff --git a/app/lib/bridge_generated.dart b/app/lib/bridge_generated.dart index 82e5361e..524a0619 100644 --- a/app/lib/bridge_generated.dart +++ b/app/lib/bridge_generated.dart @@ -1,5 +1,5 @@ // AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.82.0. +// Generated by `flutter_rust_bridge`@ 1.82.1. // ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const import "bridge_definitions.dart"; diff --git a/app/lib/bridge_generated.io.dart b/app/lib/bridge_generated.io.dart index f2ab6ffb..4d9456e3 100644 --- a/app/lib/bridge_generated.io.dart +++ b/app/lib/bridge_generated.io.dart @@ -1,5 +1,5 @@ // AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.82.0. +// Generated by `flutter_rust_bridge`@ 1.82.1. // ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const import "bridge_definitions.dart"; diff --git a/app/lib/bridge_generated.web.dart b/app/lib/bridge_generated.web.dart index 903baf20..08adf535 100644 --- a/app/lib/bridge_generated.web.dart +++ b/app/lib/bridge_generated.web.dart @@ -1,5 +1,5 @@ // AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.82.0. +// Generated by `flutter_rust_bridge`@ 1.82.1. // ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const import "bridge_definitions.dart"; diff --git a/app/native/src/bridge_generated.rs b/app/native/src/bridge_generated.rs index b7db0501..6938fdfd 100644 --- a/app/native/src/bridge_generated.rs +++ b/app/native/src/bridge_generated.rs @@ -9,7 +9,7 @@ clippy::too_many_arguments )] // AUTO GENERATED FILE, DO NOT EDIT. -// Generated by `flutter_rust_bridge`@ 1.82.0. +// Generated by `flutter_rust_bridge`@ 1.82.1. use crate::api::*; use core::panic::UnwindSafe;