From 6bc4163b2b69f47f86b60633230de973dbba0b63 Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 9 May 2022 00:32:29 +0800 Subject: [PATCH 01/24] =?UTF-8?q?fix.=E6=9B=B4=E6=96=B0=E4=BC=81=E9=B9=85?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E5=BA=93=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E8=AF=86=E5=88=AB=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../include/penguin-stats-recognize/depot.hpp | 8 +- .../penguin-stats-recognize/recognize.hpp | 9 +- .../penguin-stats-recognize/recognizer.hpp | 8 +- .../penguin-stats-recognize/result.hpp | 125 +++++++++++------- 4 files changed, 92 insertions(+), 58 deletions(-) diff --git a/3rdparty/include/penguin-stats-recognize/depot.hpp b/3rdparty/include/penguin-stats-recognize/depot.hpp index b2ab6b3c59..704a51de9d 100644 --- a/3rdparty/include/penguin-stats-recognize/depot.hpp +++ b/3rdparty/include/penguin-stats-recognize/depot.hpp @@ -16,6 +16,7 @@ using dict = nlohmann::ordered_json; namespace penguin { + enum CircleFlags { X = 0, @@ -36,7 +37,7 @@ public: _get_item_list(); return *this; } - const dict report([[maybe_unused]] bool debug = false) + const dict report(bool debug = false) { dict _report = dict::object(); return _report; @@ -112,7 +113,7 @@ private: } } } - _item_diameter = static_cast(round(cv::mean(item_circles)[R] * 2)); + _item_diameter = round(cv::mean(item_circles)[R] * 2); for (const cv::Vec3i& c : item_circles) { @@ -127,7 +128,7 @@ private: // show_img(img_blur); int radius = _item_diameter / 2; - int offset = static_cast(radius * 1.2); + int offset = radius * 1.2; ItemTemplates templs; for (const cv::Vec3i& c : item_circles) { @@ -156,6 +157,7 @@ private: // show_img(_img_ext); } }; + } // namespace penguin #endif // PENGUIN_DEPOT_HPP_ diff --git a/3rdparty/include/penguin-stats-recognize/recognize.hpp b/3rdparty/include/penguin-stats-recognize/recognize.hpp index bd0327d908..e8e0acec3a 100644 --- a/3rdparty/include/penguin-stats-recognize/recognize.hpp +++ b/3rdparty/include/penguin-stats-recognize/recognize.hpp @@ -15,6 +15,7 @@ using dict = nlohmann::ordered_json; namespace penguin { + enum class StatusFlags { NORMAL = 0, @@ -842,9 +843,11 @@ private: } void _get_quantity() { - cv::Rect quantityrect = cv::Rect(0, static_cast(round(height * _ITEM_QTY_Y_PROP)), - static_cast(round(width * _ITEM_QTY_WIDTH_PROP)), - static_cast(round(height * _ITEM_QTY_HEIGHT_PROP))); + cv::Rect quantityrect = + cv::Rect(0, + static_cast(round(height * _ITEM_QTY_Y_PROP)), + static_cast(round(width * _ITEM_QTY_WIDTH_PROP)), + static_cast(round(height * _ITEM_QTY_HEIGHT_PROP))); cv::Mat quantityimg = _img(quantityrect); _quantity.set_img(quantityimg); _quantity.analyze(); diff --git a/3rdparty/include/penguin-stats-recognize/recognizer.hpp b/3rdparty/include/penguin-stats-recognize/recognizer.hpp index 070664a2c2..1ec99ff572 100644 --- a/3rdparty/include/penguin-stats-recognize/recognizer.hpp +++ b/3rdparty/include/penguin-stats-recognize/recognizer.hpp @@ -18,7 +18,13 @@ #include "depot.hpp" #include "result.hpp" -static const std::string version = "4.2.3"; +#ifdef PENGUIN_RECOGNIZER_RELEASE_VERSION +#define PENGUIN_RECOGNIZER_VERSION_STRING PENGUIN_RECOGNIZER_RELEASE_VERSION +#else +#define PENGUIN_RECOGNIZER_VERSION_STRING "v0.0.0" +#endif + +static const std::string version = PENGUIN_RECOGNIZER_VERSION_STRING; static const std::string opencv_version = CV_VERSION; cv::Mat decode(std::string JSarrayBuffer) diff --git a/3rdparty/include/penguin-stats-recognize/result.hpp b/3rdparty/include/penguin-stats-recognize/result.hpp index 0d9a639550..ae40bbbeb7 100644 --- a/3rdparty/include/penguin-stats-recognize/result.hpp +++ b/3rdparty/include/penguin-stats-recognize/result.hpp @@ -31,7 +31,7 @@ const double DROP_AREA_X_PROP = 0.21; const double DROP_AREA_Y_PROP = 0.2; const double DROP_AREA_HEIGHT_PROP = 0.8; const double ITEM_DIAMETER_PROP = 0.524; -const double W_H_PROP = 7; +const double W_H_PROP = 6.5; enum DroptypeFlags { @@ -201,7 +201,7 @@ public: } private: - size_t _stars = 0; + int _stars = 0; void _get_is_3stars() { auto& self = *this; @@ -232,7 +232,7 @@ private: star_rect.width = sp.back().end - star_rect.x; _img = star_img = star_img(star_rect); self._relate(star_rect.tl()); - _stars = sp.size(); + _stars = static_cast(sp.size()); } }; @@ -612,7 +612,7 @@ private: { continue; } - int dist = static_cast(abs(kh - hsv[H])); + int dist = static_cast(round(abs(kh - hsv[H]))); _candidates.emplace_back(vtype, dist); } std::sort(_candidates.begin(), _candidates.end(), @@ -751,11 +751,23 @@ public: const int items_count() const { return _items_count; } Widget_Droptype() = default; Widget_Droptype(const cv::Mat& img, const std::string& label, Widget* const parent_widget = nullptr) - : WidgetWithCandidate(img, label, parent_widget) {} + : WidgetWithCandidate(label, parent_widget) + { + set_img(img); + } + void set_img(const cv::Mat& img) + { + cv::Mat img_bin = img; + cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); + cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY); + int bottom = separate(img_bin, DirectionFlags::BOTTOM, 1)[0].end; + Widget::set_img(img(cv::Rect(0, 0, img.cols, bottom))); + } Widget_Droptype& analyze() { if (!_img.empty()) { + _get_items_count(); _get_candidates(); } if (const auto type = droptype(); @@ -790,7 +802,7 @@ public: } private: - int _items_count = static_cast(round(width / (height * W_H_PROP))); + int _items_count = 0; Widget_DroptypeLine _line {this}; Widget_DroptypeText _text {this}; void _get_candidates() @@ -809,6 +821,10 @@ private: _candidates = _text.candidates(); } } + void _get_items_count() + { + _items_count = static_cast(round(width / (height * W_H_PROP))); + } }; class Widget_DropArea : public Widget @@ -827,8 +843,7 @@ public: : Widget("dropArea", parent_widget) {} Widget_DropArea(const cv::Mat& img, Widget* const parent_widget = nullptr) : Widget(img, "dropArea", parent_widget) {} - Widget_DropArea& analyze(const std::string& stage, - const std::string& difficulty) + Widget_DropArea& analyze(const std::string& stage) { if (!_img.empty()) { @@ -849,7 +864,7 @@ public: widget_label = "droptypes"; push_exception(ERROR, ExcSubtypeFlags::EXC_ILLEGAL); } - _get_drops(stage, difficulty); + _get_drops(stage); } else { @@ -995,7 +1010,7 @@ private: _droptype_list = q.top(); } - void _get_drops(const std::string& stage, [[maybe_unused]] const std::string& difficulty) + void _get_drops(const std::string& stage) { if (_status == StatusFlags::HAS_ERROR || _status == StatusFlags::ERROR) { @@ -1015,10 +1030,10 @@ private: { continue; } - else if (std::string label = - "drops." + std::to_string(_drop_list.size()); - type == DroptypeFlags::FURNITURE) + else if (type == DroptypeFlags::FURNITURE) { + std::string label = + "drops." + std::to_string(_drop_list.size()); _drop_list.emplace_back( Drop(Widget_Item(FURNI_1, label, this), type)); } @@ -1034,13 +1049,13 @@ private: int length = (droptype.width) / items_count; for (int i = 0; i < items_count; i++) { - std::string cur_label = + std::string label = "drops." + std::to_string(_drop_list.size()); auto range = cv::Range(droptype.x - x + length * i, droptype.x - x + length * (i + 1)); auto dropimg = _img(cv::Range(0, droptype.y - y), range); - Widget_Item drop {dropimg, item_diameter, cur_label, this}; + Widget_Item drop {dropimg, item_diameter, label, this}; drop.analyze(templs); _drop_list.emplace_back(drop, type); _drops_data.push_back({{"dropType", Droptype2Str[type]}, @@ -1216,10 +1231,10 @@ private: } const auto& bv = _baseline_v; auto drop_area_img = _img( - cv::Range(static_cast(bv.y + bv.height * DROP_AREA_Y_PROP), bv.y + bv.height), - cv::Range(static_cast(bv.x + bv.height * DROP_AREA_X_PROP), width)); + cv::Range(bv.y + static_cast(bv.height * DROP_AREA_Y_PROP), bv.y + bv.height), + cv::Range(bv.x + static_cast(bv.height * DROP_AREA_X_PROP), width)); _drop_area.set_img(drop_area_img); - _drop_area.analyze(_stage.stage_code(), "NORMAL"); + _drop_area.analyze(_stage.stage_code()); } }; @@ -1285,11 +1300,10 @@ private: { return; } - cv::Mat img_bin = _img(cv::Rect( - 0, - static_cast(0.2 * height), - static_cast(0.2 * width), - static_cast(0.4 * height))); + cv::Mat img_bin = _img(cv::Rect(0, + static_cast(0.2 * height), + static_cast(0.2 * width), + static_cast(0.4 * height))); cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 120, 255, cv::THRESH_BINARY); @@ -1309,8 +1323,9 @@ private: abs(img_temp.cols - last_height) <= 1 && abs(first_height - last_height) <= 1) { - baseline_v_rect = cv::Rect(range.start, sp2.front().start + static_cast(0.2 * height), - img_temp.cols, sp2.back().end - sp2.front().start); + baseline_v_rect = + cv::Rect(range.start, sp2.front().start + static_cast(0.2 * height), + img_temp.cols, sp2.back().end - sp2.front().start); break; } } @@ -1336,11 +1351,10 @@ private: : x(x_), y(y_), width(width_), height(height_), area(area_) {} }; - cv::Mat img_bin = _img(cv::Rect( - 0, - static_cast(0.2 * height), - static_cast(0.2 * width), - static_cast(0.4 * height))); + cv::Mat img_bin = _img(cv::Rect(0, + static_cast(0.2 * height), + static_cast(0.2 * width), + static_cast(0.4 * height))); cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 120, 255, cv::THRESH_BINARY); cv::Mat _; @@ -1381,10 +1395,11 @@ private: { if (ccomps[0].x == ccomps[1].x) { - baseline_v_rect = cv::Rect(ccomps[0].x, - ccomps[0].y + static_cast(0.2 * height), - ccomps[0].width, - ccomps[1].y - ccomps[0].y + ccomps[1].height); + baseline_v_rect = + cv::Rect(ccomps[0].x, + ccomps[0].y + static_cast(0.2 * height), + ccomps[0].width, + ccomps[1].y - ccomps[0].y + ccomps[1].height); } } else if (const auto ccsize = ccomps.size(); @@ -1393,10 +1408,11 @@ private: for (int i = 0; i < ccsize - 1; ++i) { if (ccomps[i].x == ccomps[i + 1].x) - baseline_v_rect = cv::Rect(ccomps[i].x, - ccomps[i].y + static_cast(0.2 * height), - ccomps[i].width, - ccomps[i + 1].y - ccomps[i].y + ccomps[i + 1].height); + baseline_v_rect = + cv::Rect(ccomps[i].x, + ccomps[i].y + static_cast(0.2 * height), + ccomps[i].width, + ccomps[i + 1].y - ccomps[i].y + ccomps[i + 1].height); } } @@ -1420,8 +1436,9 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto result_img = _img(cv::Range(bv.y, bv.y + bv.height / 2), - cv::Range(left_margin, static_cast(left_margin + 1.5 * bv.height))); + auto result_img = + _img(cv::Range(bv.y, bv.y + bv.height / 2), + cv::Range(left_margin, left_margin + static_cast(1.5 * bv.height))); cv::Mat img_bin; cv::cvtColor(result_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 200, 255, cv::THRESH_BINARY); @@ -1438,8 +1455,9 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto star_img = _img(cv::Range(bv.y + bv.height / 2, bv.y + bv.height), - cv::Range(left_margin, static_cast(left_margin + 1.2 * bv.height))); + auto star_img = + _img(cv::Range(bv.y + bv.height / 2, bv.y + bv.height), + cv::Range(left_margin, left_margin + static_cast(1.2 * bv.height))); cv::Mat img_bin; cv::cvtColor(star_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY); @@ -1456,9 +1474,10 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto stage_img = _img(cv::Range(0, bv.y), - cv::Range(static_cast(left_margin + 0.43 * bv.height), - static_cast(left_margin + 1.5 * bv.height))); + auto stage_img = + _img(cv::Range(0, bv.y), + cv::Range(left_margin + static_cast(0.43 * bv.height), + left_margin + static_cast(1.5 * bv.height))); cv::Mat img_bin; cv::cvtColor(stage_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 200, 255, cv::THRESH_BINARY); @@ -1475,8 +1494,9 @@ private: } const auto& bv = _baseline_v; int left_margin = bv.x + bv.width; - auto diff_img = _img(cv::Range(0, bv.y), - cv::Range(left_margin, static_cast(left_margin + 0.43 * bv.height))); + auto diff_img = + _img(cv::Range(0, bv.y), + cv::Range(left_margin, left_margin + static_cast(0.43 * bv.height))); cv::Mat img_bin; cv::cvtColor(diff_img, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 64, 255, cv::THRESH_BINARY); @@ -1492,19 +1512,22 @@ private: return; } const auto& bv = _baseline_v; - cv::Mat img_bin = _img(cv::Range(bv.y + bv.height, height), - cv::Range(bv.x + bv.width, static_cast(0.2 * width))); + cv::Mat img_bin = + _img(cv::Range(bv.y + bv.height, height), + cv::Range(bv.x + bv.width, static_cast(0.2 * width))); cv::cvtColor(img_bin, img_bin, cv::COLOR_BGR2GRAY); cv::threshold(img_bin, img_bin, 127, 255, cv::THRESH_BINARY); auto sp = separate(img_bin, DirectionFlags::TOP, 2); int top_margin = bv.y + bv.height + sp[1].start; auto drop_area_img = _img( - cv::Range(top_margin + static_cast(bv.height * DROP_AREA_Y_PROP), top_margin + bv.height), + cv::Range(top_margin + static_cast(bv.height * DROP_AREA_Y_PROP), + top_margin + bv.height), cv::Range(bv.x + bv.width, width)); _drop_area.set_img(drop_area_img); - _drop_area.analyze(_stage.stage_code(), _difficutly.difficulty()); + _drop_area.analyze(_stage.stage_code()); } }; + } // namespace penguin #endif // PENGUIN_RESULT_HPP_ From 7bd8a0d0599149dcc6d35b17bf7ac236d912822e Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 9 May 2022 00:33:22 +0800 Subject: [PATCH 02/24] =?UTF-8?q?chore.=E6=9B=B4=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7v3.3.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAssistant/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MeoAssistant/Version.h b/src/MeoAssistant/Version.h index efb55c9201..f2a33f6ba9 100644 --- a/src/MeoAssistant/Version.h +++ b/src/MeoAssistant/Version.h @@ -2,5 +2,5 @@ namespace asst { - constexpr static const char* Version = "v3.3.1"; + constexpr static const char* Version = "v3.3.2"; } From a2d6617a0fca66df5f07012ff12bb89c873970d1 Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Sun, 8 May 2022 01:26:06 +0800 Subject: [PATCH 03/24] =?UTF-8?q?chore.=E4=BF=AE=E6=94=B9=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=96=87=E4=BB=B6=E4=BB=A5=E9=80=82=E9=85=8D=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + MeoAssistantArknights.sln | 55 +- src/MeoAssistant/MeoAssistant.vcxproj | 617 ++++++++++-------- src/MeoAsstGui/MeoAsstGui.csproj | 60 +- .../Properties/Resources.Designer.cs | 72 -- src/MeoAsstGui/Properties/Resources.resx | 117 ---- .../Properties/Settings.Designer.cs | 30 - src/MeoAsstGui/Properties/Settings.settings | 7 - 8 files changed, 393 insertions(+), 566 deletions(-) delete mode 100644 src/MeoAsstGui/Properties/Resources.Designer.cs delete mode 100644 src/MeoAsstGui/Properties/Resources.resx delete mode 100644 src/MeoAsstGui/Properties/Settings.Designer.cs delete mode 100644 src/MeoAsstGui/Properties/Settings.settings diff --git a/.gitignore b/.gitignore index 025aa6f8be..77f946f4f5 100644 --- a/.gitignore +++ b/.gitignore @@ -436,3 +436,4 @@ adb_screen.png tools/**/*.png resource/infrast .vscode +!3rdparty/tools/* diff --git a/MeoAssistantArknights.sln b/MeoAssistantArknights.sln index 513ca97847..a2deaf4e91 100644 --- a/MeoAssistantArknights.sln +++ b/MeoAssistantArknights.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31515.178 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32414.318 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{6C4B8D52-51D1-45F8-AAEC-808035443FD6}" EndProject @@ -11,9 +11,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCaller", "tools\TestCal EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MeoAsstGui", "src\MeoAsstGui\MeoAsstGui.csproj", "{FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}" - ProjectSection(ProjectDependencies) = postProject - {362D1E30-F5AE-4279-9985-65C27B3BA300} = {362D1E30-F5AE-4279-9985-65C27B3BA300} - EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TransparentImageCvt", "tools\TransparentImageCvt\TransparentImageCvt.vcxproj", "{093A3174-A27E-4D23-B64E-16F9448AD5AC}" EndProject @@ -24,44 +21,52 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MeoAssistantBuilder", "src\MeoAssistantBuilder\MeoAssistantBuilder.csproj", "{8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + CICD|x64 = CICD|x64 + Debug|x64 = Debug|x64 Release|x64 = Release|x64 - Release|x86 = Release|x86 RelWithDebInfo|x64 = RelWithDebInfo|x64 - RelWithDebInfo|x86 = RelWithDebInfo|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.CICD|x64.ActiveCfg = RelWithDebInfo|x64 + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.CICD|x64.Build.0 = RelWithDebInfo|x64 + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Debug|x64.ActiveCfg = RelWithDebInfo|x64 + {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Debug|x64.Build.0 = RelWithDebInfo|x64 {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x64.ActiveCfg = Release|x64 {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x64.Build.0 = Release|x64 - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.Release|x86.ActiveCfg = Release|x64 {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - {63B4F1A2-291C-4C85-91E1-A1F6DAE30D64}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.ActiveCfg = Release|Any CPU - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.Build.0 = Release|Any CPU - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x86.ActiveCfg = Release|Any CPU - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x86.Build.0 = Release|Any CPU - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|Any CPU - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|Any CPU - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|Any CPU - {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|Any CPU + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.CICD|x64.ActiveCfg = CICD|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.CICD|x64.Build.0 = CICD|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Debug|x64.ActiveCfg = Release|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.ActiveCfg = Release|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.Release|x64.Build.0 = Release|x64 + {FFDC8F49-8EAF-45BE-B0A8-7EF0DB9875A2}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 + {093A3174-A27E-4D23-B64E-16F9448AD5AC}.CICD|x64.ActiveCfg = Release|x64 + {093A3174-A27E-4D23-B64E-16F9448AD5AC}.CICD|x64.Build.0 = Release|x64 + {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Debug|x64.ActiveCfg = Release|x64 + {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Debug|x64.Build.0 = Release|x64 {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x64.ActiveCfg = Release|x64 {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x64.Build.0 = Release|x64 - {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x86.ActiveCfg = Release|Win32 - {093A3174-A27E-4D23-B64E-16F9448AD5AC}.Release|x86.Build.0 = Release|Win32 {093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x64.Build.0 = Release|x64 - {093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x86.ActiveCfg = Release|Win32 - {093A3174-A27E-4D23-B64E-16F9448AD5AC}.RelWithDebInfo|x86.Build.0 = Release|Win32 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.CICD|x64.ActiveCfg = CICD|x64 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.CICD|x64.Build.0 = CICD|x64 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.Debug|x64.ActiveCfg = RelWithDebInfo|x64 + {362D1E30-F5AE-4279-9985-65C27B3BA300}.Debug|x64.Build.0 = RelWithDebInfo|x64 {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x64.ActiveCfg = Release|x64 {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x64.Build.0 = Release|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x86.ActiveCfg = Release|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.Release|x86.Build.0 = Release|x64 {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64 {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x64 - {362D1E30-F5AE-4279-9985-65C27B3BA300}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.CICD|x64.ActiveCfg = Release|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.CICD|x64.Build.0 = Release|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.Debug|x64.ActiveCfg = Debug|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.Release|x64.ActiveCfg = Release|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.Release|x64.Build.0 = Release|x64 + {8D9036DD-75F1-4BD0-89E2-DFB37B925DA3}.RelWithDebInfo|x64.ActiveCfg = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/MeoAssistant/MeoAssistant.vcxproj b/src/MeoAssistant/MeoAssistant.vcxproj index d3be7e62ce..bc44ff174b 100644 --- a/src/MeoAssistant/MeoAssistant.vcxproj +++ b/src/MeoAssistant/MeoAssistant.vcxproj @@ -1,280 +1,337 @@ - - - - - Release - x64 - - - RelWithDebInfo - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 16.0 - Win32Proj - {362d1e30-f5ae-4279-9985-65c27b3ba300} - MeoAssistant - 10.0 - - - - DynamicLibrary - false - v143 - true - Unicode - - - DynamicLibrary - false - v143 - true - Unicode - - - - - - - - - - - - - - - false - $(SolutionDir)include;$(SolutionDir)3rdparty\include;$(IncludePath) - $(TargetDir);$(SolutionDir)\3rdparty\lib;$(LibraryPath) - - - false - $(SolutionDir)include;$(SolutionDir)3rdparty\include;$(IncludePath) - $(TargetDir);$(SolutionDir)\3rdparty\lib;$(LibraryPath) - - - - Level4 - true - true - true - NDEBUG;_CONSOLE;ASST_DLL_EXPORTS;%(PreprocessorDefinitions) - true - stdcpp17 - stdc11 - MultiThreaded - MaxSpeed - /utf-8 /MP %(AdditionalOptions) - - - Console - true - true - true - ppocr.lib;opencv_world453.lib;zlibstatic.lib;%(AdditionalDependencies) - RequireAdministrator - - - true - msvcrt.lib - - - - - - - xcopy /e /y /i /c $(SolutionDir)resource $(TargetDir)resource -xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource - - - copy resource - - - xcopy /e /y /i /c $(SolutionDir)3rdparty\bin $(TargetDir) - - - copy 3rd party dll - - - - - Level4 - - - false - true - NDEBUG;_CONSOLE;ASST_DLL_EXPORTS;ASST_DEBUG;%(PreprocessorDefinitions) - true - stdcpp17 - stdc11 - MultiThreaded - Disabled - true - EnableFastChecks - /utf-8 /MP %(AdditionalOptions) - - - Console - true - true - true - ppocr.lib;opencv_world453.lib;zlibstatic.lib;%(AdditionalDependencies) - RequireAdministrator - - - true - msvcrt.lib - - - - - - - xcopy /e /y /i /c $(SolutionDir)resource $(TargetDir)resource -xcopy /e /y /i /c $(SolutionDir)3rdparty\resource $(TargetDir)resource - - - copy resource - - - xcopy /e /y /i /c $(SolutionDir)3rdparty\bin $(TargetDir) - - - copy 3rd party dll - - - - - - - - - - - \ No newline at end of file + + + + + Release + x64 + + + RelWithDebInfo + x64 + + + CICD + x64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 16.0 + Win32Proj + {362d1e30-f5ae-4279-9985-65c27b3ba300} + MeoAssistant + 10.0 + + + + DynamicLibrary + false + v143 + true + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + false + $(ProjectDir)..\..\include;$(ProjectDir)..\..\3rdparty\include;$(IncludePath) + $(TargetDir);$(ProjectDir)..\..\3rdparty\lib;$(LibraryPath) + $(ProjectDir)..\..\$(Platform)\$(Configuration)\ + + + false + $(ProjectDir)..\..\include;$(ProjectDir)..\..\3rdparty\include;$(IncludePath) + $(TargetDir);$(ProjectDir)..\..\3rdparty\lib;$(LibraryPath) + $(ProjectDir)..\..\$(Platform)\$(Configuration)\ + + + false + $(ProjectDir)..\..\include;$(ProjectDir)..\..\3rdparty\include;$(IncludePath) + $(TargetDir);$(ProjectDir)..\..\3rdparty\lib;$(LibraryPath) + $(ProjectDir)..\..\$(Platform)\$(Configuration)\ + + + + Level4 + true + true + true + NDEBUG;_CONSOLE;ASST_DLL_EXPORTS;%(PreprocessorDefinitions) + true + stdcpp17 + stdc11 + MultiThreaded + MaxSpeed + /utf-8 /MP %(AdditionalOptions) + + + Console + true + true + true + ppocr.lib;opencv_world453.lib;zlibstatic.lib;%(AdditionalDependencies) + RequireAdministrator + + + true + msvcrt.lib + + + + + + + + xcopy /e /y /i /c $(ProjectDir)..\..\resource $(TargetDir)resource + xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\resource $(TargetDir)resource + + + + Copy resource + + + + xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\bin $(TargetDir) + + + + Copy 3rd party dll + + + + + Level4 + true + true + true + NDEBUG;_CONSOLE;ASST_DLL_EXPORTS;%(PreprocessorDefinitions) + true + stdcpp17 + stdc11 + MultiThreaded + MaxSpeed + /utf-8 /MP %(AdditionalOptions) + + + Console + true + true + true + ppocr.lib;opencv_world453.lib;zlibstatic.lib;%(AdditionalDependencies) + RequireAdministrator + + + true + msvcrt.lib + + + + + Level4 + + + false + true + NDEBUG;_CONSOLE;ASST_DLL_EXPORTS;ASST_DEBUG;%(PreprocessorDefinitions) + true + stdcpp17 + stdc11 + MultiThreaded + Disabled + true + EnableFastChecks + /utf-8 /MP %(AdditionalOptions) + + + Console + true + true + true + ppocr.lib;opencv_world453.lib;zlibstatic.lib;%(AdditionalDependencies) + RequireAdministrator + + + true + msvcrt.lib + + + + + + + + xcopy /e /y /i /c $(ProjectDir)..\..\resource $(TargetDir)resource + xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\resource $(TargetDir)resource + + + + Copy resource + + + + xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\bin $(TargetDir) + + + + Copy 3rd party dll + + + + + + + + + + + diff --git a/src/MeoAsstGui/MeoAsstGui.csproj b/src/MeoAsstGui/MeoAsstGui.csproj index 7d8ee09952..500b1633c0 100644 --- a/src/MeoAsstGui/MeoAsstGui.csproj +++ b/src/MeoAsstGui/MeoAsstGui.csproj @@ -38,23 +38,25 @@ false true - - x64 - pdbonly - true - ..\..\x64\Release\ - TRACE - prompt - 4 - false - - Always + OnBuildSuccess newlogo.ico - + + MeoAsstGui.App + + + ..\..\x64\Release\ + TRACE + true + pdbonly + x64 + 7.3 + prompt + + ..\..\x64\RelWithDebInfo\ DEBUG;TRACE false @@ -63,8 +65,15 @@ 7.3 prompt - - MeoAsstGui.App + + ..\..\x64\CICD\ + TRACE + true + pdbonly + x64 + 7.3 + prompt + true @@ -225,26 +234,7 @@ Code - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - SettingsSingleFileGenerator - Settings.Designer.cs - @@ -252,7 +242,7 @@ False - Microsoft .NET Framework 4.7.2 %28x86 和 x64%29 + Microsoft .NET Framework 4.7.2 %28x86 and x64%29 true @@ -417,6 +407,6 @@ - xcopy /e /y /i /c $(SolutionDir)resource $(TargetDir)resource + xcopy /e /y /i /c $(ProjectDir)..\..\3rdparty\tools $(TargetDir) \ No newline at end of file diff --git a/src/MeoAsstGui/Properties/Resources.Designer.cs b/src/MeoAsstGui/Properties/Resources.Designer.cs deleted file mode 100644 index 18701c716e..0000000000 --- a/src/MeoAsstGui/Properties/Resources.Designer.cs +++ /dev/null @@ -1,72 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -namespace MeoAsstGui.Properties -{ - using System; - - - /// - /// 一个强类型的资源类,用于查找本地化的字符串等。 - /// - // 此类是由 StronglyTypedResourceBuilder - // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 - // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen - // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { - } - - /// - /// 返回此类使用的缓存的 ResourceManager 实例。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if (object.ReferenceEquals(resourceMan, null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MeoAsstGui.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// 重写当前线程的 CurrentUICulture 属性,对 - /// 使用此强类型资源类的所有资源查找执行重写。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/src/MeoAsstGui/Properties/Resources.resx b/src/MeoAsstGui/Properties/Resources.resx deleted file mode 100644 index af7dbebbac..0000000000 --- a/src/MeoAsstGui/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/MeoAsstGui/Properties/Settings.Designer.cs b/src/MeoAsstGui/Properties/Settings.Designer.cs deleted file mode 100644 index af956e4392..0000000000 --- a/src/MeoAsstGui/Properties/Settings.Designer.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -namespace MeoAsstGui.Properties -{ - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { - return defaultInstance; - } - } - } -} diff --git a/src/MeoAsstGui/Properties/Settings.settings b/src/MeoAsstGui/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9e..0000000000 --- a/src/MeoAsstGui/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file From 164728eb9cb7e2c2ad686948bcfd5a2e1adc81d4 Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 9 May 2022 00:53:55 +0800 Subject: [PATCH 04/24] =?UTF-8?q?chore.=E6=9B=B4=E6=96=B0=E4=BC=81?= =?UTF-8?q?=E9=B9=85=E5=BA=93=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/MaaAssistantArknights/recognizer/commit/cf5ebbc89c84684179a4d2c7e7ccdbc131960a2c --- 3rdparty/include/penguin-stats-recognize/depot.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/3rdparty/include/penguin-stats-recognize/depot.hpp b/3rdparty/include/penguin-stats-recognize/depot.hpp index 704a51de9d..6e7d46798e 100644 --- a/3rdparty/include/penguin-stats-recognize/depot.hpp +++ b/3rdparty/include/penguin-stats-recognize/depot.hpp @@ -16,7 +16,6 @@ using dict = nlohmann::ordered_json; namespace penguin { - enum CircleFlags { X = 0, @@ -37,7 +36,7 @@ public: _get_item_list(); return *this; } - const dict report(bool debug = false) + const dict report([[maybe_unused]] bool debug = false) { dict _report = dict::object(); return _report; @@ -113,7 +112,7 @@ private: } } } - _item_diameter = round(cv::mean(item_circles)[R] * 2); + _item_diameter = static_cast(round(cv::mean(item_circles)[R] * 2)); for (const cv::Vec3i& c : item_circles) { @@ -128,7 +127,7 @@ private: // show_img(img_blur); int radius = _item_diameter / 2; - int offset = radius * 1.2; + int offset = static_cast(radius * 1.2); ItemTemplates templs; for (const cv::Vec3i& c : item_circles) { @@ -157,7 +156,6 @@ private: // show_img(_img_ext); } }; - } // namespace penguin -#endif // PENGUIN_DEPOT_HPP_ +#endif // PENGUIN_DEPOT_HPP_ \ No newline at end of file From 311ce4d84969a41076cfd3fa64e0926ef5b69f4a Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 13:05:28 +0800 Subject: [PATCH 05/24] =?UTF-8?q?bump.=E6=B8=85=E7=90=86=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAsstGui/MeoAsstGui.csproj | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/MeoAsstGui/MeoAsstGui.csproj b/src/MeoAsstGui/MeoAsstGui.csproj index 500b1633c0..9d8e758887 100644 --- a/src/MeoAsstGui/MeoAsstGui.csproj +++ b/src/MeoAsstGui/MeoAsstGui.csproj @@ -76,24 +76,9 @@ true - - ..\..\packages\Costura.Fody.5.6.0\lib\netstandard1.0\Costura.dll - - - ..\..\packages\gong-wpf-dragdrop.2.4.1\lib\net47\GongSolutions.WPF.DragDrop.dll - - - ..\..\packages\HandyControl.3.2.0\lib\net472\HandyControl.dll - - - ..\..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll - ..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - ..\..\packages\Stylet.1.3.6\lib\net45\Stylet.dll - @@ -261,13 +246,13 @@ all - 2.4.3 + 3.1.1 3.3.0 - 5.0.4 + 6.0.3 4.3.0 @@ -279,7 +264,7 @@ 13.0.1 - 6.1.0.1 + 6.1.0.5 1.3.6 @@ -300,7 +285,7 @@ 4.3.0 - 5.0.1 + 6.0.0 4.3.0 From 4de65cc66ec0ac4b88d684fdb1e0bf5743f50393 Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 13:05:46 +0800 Subject: [PATCH 06/24] =?UTF-8?q?feat.=E6=B7=BB=E5=8A=A0=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAssistantBuilder/Constants.cs | 23 ++++ .../Helper/BuildCoreHelper.cs | 17 +++ .../Helper/BuildWpfHelper.cs | 18 ++++ .../Helper/CleanDirectoryHelper.cs | 60 +++++++++++ .../Helper/FileCopyHelper.cs | 53 +++++++++ .../Helper/GetBuildInformationHelper.cs | 38 +++++++ src/MeoAssistantBuilder/MaaBuildContext.cs | 28 +++++ .../MeoAssistantBuilder.csproj | 17 +++ src/MeoAssistantBuilder/Program.cs | 15 +++ src/MeoAssistantBuilder/README.md | 23 ++++ src/MeoAssistantBuilder/Tasks/DevBuildTask.cs | 78 ++++++++++++++ .../Tasks/ReleaseCoreTask.cs | 102 ++++++++++++++++++ .../Tasks/ReleaseResourceTask.cs | 58 ++++++++++ .../Tasks/ReleaseWpfTask.cs | 61 +++++++++++ 14 files changed, 591 insertions(+) create mode 100644 src/MeoAssistantBuilder/Constants.cs create mode 100644 src/MeoAssistantBuilder/Helper/BuildCoreHelper.cs create mode 100644 src/MeoAssistantBuilder/Helper/BuildWpfHelper.cs create mode 100644 src/MeoAssistantBuilder/Helper/CleanDirectoryHelper.cs create mode 100644 src/MeoAssistantBuilder/Helper/FileCopyHelper.cs create mode 100644 src/MeoAssistantBuilder/Helper/GetBuildInformationHelper.cs create mode 100644 src/MeoAssistantBuilder/MaaBuildContext.cs create mode 100644 src/MeoAssistantBuilder/MeoAssistantBuilder.csproj create mode 100644 src/MeoAssistantBuilder/Program.cs create mode 100644 src/MeoAssistantBuilder/README.md create mode 100644 src/MeoAssistantBuilder/Tasks/DevBuildTask.cs create mode 100644 src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs create mode 100644 src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs create mode 100644 src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs diff --git a/src/MeoAssistantBuilder/Constants.cs b/src/MeoAssistantBuilder/Constants.cs new file mode 100644 index 0000000000..7b67b1daf4 --- /dev/null +++ b/src/MeoAssistantBuilder/Constants.cs @@ -0,0 +1,23 @@ +namespace MeoAssistantBuilder; + +public static class Constants +{ + public const string MaaProjectRootDirectory = "../../"; + public const string MaaProjectThirdPartyDirectory = "../../3rdparty"; + public const string MaaProjectResourceDirectory = "../../resource"; + public const string MaaProjectArtifactDirectory = "../../artifacts"; + + public const string MaaCoreProjectDirectory = "../MeoAssistant"; + public const string MaaWpfProjectDirectory = "../MeoAsstGui"; + + public const string MaaCoreProjectFilePath = $"{MaaCoreProjectDirectory}/MeoAssistant.vcxproj"; + public const string MaaWpfProjectFilePath = $"{MaaWpfProjectDirectory}/MeoAsstGui.csproj"; + + public const string MaaBuildOutputDirectory = $"{MaaProjectRootDirectory}/x64"; + + public const string MaaCoreBuildIntermediatOutputDirectory = $"{MaaCoreProjectDirectory}/x64"; + + public static readonly string[] MaaCoreExtraFiles = new [] { "MeoAssistant.pdb", "MeoAssistant.lib", "MeoAssistant.exp" }; + + public static readonly string[] MaaWpfExtraFiles = new[] { "MeoAsstGui.pdb", "MeoAsstGui.exe.config" }; +} diff --git a/src/MeoAssistantBuilder/Helper/BuildCoreHelper.cs b/src/MeoAssistantBuilder/Helper/BuildCoreHelper.cs new file mode 100644 index 0000000000..078a94f099 --- /dev/null +++ b/src/MeoAssistantBuilder/Helper/BuildCoreHelper.cs @@ -0,0 +1,17 @@ +using Cake.Common.Tools.MSBuild; + +namespace MeoAssistantBuilder.Helper; + +public static class BuildCoreHelper +{ + public static void BuildCore(this MaaBuildContext context, string configuration) + { + context.MSBuild(Constants.MaaCoreProjectFilePath, new MSBuildSettings + { + WorkingDirectory = Constants.MaaProjectRootDirectory, + ToolPath = context.MsBuildExecutable, + Configuration = configuration, + PlatformTarget = PlatformTarget.x64 + }); + } +} diff --git a/src/MeoAssistantBuilder/Helper/BuildWpfHelper.cs b/src/MeoAssistantBuilder/Helper/BuildWpfHelper.cs new file mode 100644 index 0000000000..d3ed8f052a --- /dev/null +++ b/src/MeoAssistantBuilder/Helper/BuildWpfHelper.cs @@ -0,0 +1,18 @@ +using Cake.Common.Tools.MSBuild; + +namespace MeoAssistantBuilder.Helper; + +public static class BuildWpfHelper +{ + public static void BuildWpf(this MaaBuildContext context, string configuration) + { + context.MSBuild(Constants.MaaWpfProjectFilePath, new MSBuildSettings + { + WorkingDirectory = Constants.MaaProjectRootDirectory, + Restore = true, + ToolPath = context.MsBuildExecutable, + Configuration = configuration, + PlatformTarget = PlatformTarget.x64 + }); + } +} diff --git a/src/MeoAssistantBuilder/Helper/CleanDirectoryHelper.cs b/src/MeoAssistantBuilder/Helper/CleanDirectoryHelper.cs new file mode 100644 index 0000000000..44611e9631 --- /dev/null +++ b/src/MeoAssistantBuilder/Helper/CleanDirectoryHelper.cs @@ -0,0 +1,60 @@ +using Cake.Common.Diagnostics; +using Cake.Common.IO; + +namespace MeoAssistantBuilder.Helper; +public static class CleanDirectoryHelper +{ + public static void CleanArtifacts(this MaaBuildContext context) + { + context.CleanDirectory(Constants.MaaProjectArtifactDirectory); + if (Directory.Exists(Constants.MaaProjectArtifactDirectory)) + { + Directory.CreateDirectory(Constants.MaaProjectArtifactDirectory); + } + } + + public static void CleanCore(this MaaBuildContext context) + { + context.CleanDirectory(Constants.MaaBuildOutputDirectory); + context.CleanDirectory(Constants.MaaCoreBuildIntermediatOutputDirectory); + } + + public static void CleanWpf(this MaaBuildContext context) + { + context.CleanDirectory(Constants.MaaBuildOutputDirectory); + context.CleanDirectory(Path.Combine(Constants.MaaWpfProjectDirectory, "bin")); + context.CleanDirectory(Path.Combine(Constants.MaaWpfProjectDirectory, "obj")); + } + + public static void CleanAll(this MaaBuildContext context) + { + CleanCore(context); + CleanWpf(context); + } + + public static void RemoveExtraCore(this MaaBuildContext context, string buildOutput) + { + foreach (var extra in Constants.MaaCoreExtraFiles) + { + var file = Path.Combine(buildOutput, extra); + if (File.Exists(file)) + { + File.Delete(file); + context.Information($"Delete file: {file}"); + } + } + } + + public static void RemoveExtraWpf(this MaaBuildContext context, string buildOutput) + { + foreach (var extra in Constants.MaaWpfExtraFiles) + { + var file = Path.Combine(buildOutput, extra); + if (File.Exists(file)) + { + File.Delete(file); + context.Information($"Delete file: {file}"); + } + } + } +} diff --git a/src/MeoAssistantBuilder/Helper/FileCopyHelper.cs b/src/MeoAssistantBuilder/Helper/FileCopyHelper.cs new file mode 100644 index 0000000000..be2e4dcd73 --- /dev/null +++ b/src/MeoAssistantBuilder/Helper/FileCopyHelper.cs @@ -0,0 +1,53 @@ +using Cake.Common.Diagnostics; +using Cake.Common.IO; + +namespace MeoAssistantBuilder.Helper +{ + public static class FileCopyHelper + { + public static void CopyThirdPartyDlls(this MaaBuildContext context, string outputDir) + { + var thirdPartyDlls = Directory.GetFiles(Path.Combine(Constants.MaaProjectThirdPartyDirectory, "bin")); + foreach (var f in thirdPartyDlls) + { + var fileName = new FileInfo(f).Name; + context.CopyFile(f, Path.Combine(outputDir, fileName)); + context.Information($"Copy file: FROM {f} to {Path.Combine(outputDir, fileName)}"); + } + } + + public static void CopyResources(this MaaBuildContext context, string outputDir) + { + var resourceTargetDir = Path.Combine(outputDir, "resource"); + var resourceThirdParty = Path.Combine(Constants.MaaProjectRootDirectory, "3rdparty\\resource"); + var resoutceMaa = Path.Combine(Constants.MaaProjectRootDirectory, "resource"); + + var files = new List(); + var directories = new List(); + + files.AddRange(Directory.GetFiles(resourceThirdParty)); + files.AddRange(Directory.GetFiles(resoutceMaa)); + directories.AddRange(Directory.GetDirectories(resourceThirdParty)); + directories.AddRange(Directory.GetDirectories(resoutceMaa)); + + if (Directory.Exists(resourceTargetDir) is false) + { + Directory.CreateDirectory(resourceTargetDir); + } + + foreach (var f in files) + { + var fileName = new FileInfo(f).Name; + context.CopyFile(f, Path.Combine(resourceTargetDir, fileName)); + context.Information($"Copy file: FROM {f} TO {Path.Combine(resourceTargetDir, fileName)}"); + } + + foreach (var d in directories) + { + var dirName = new DirectoryInfo(d).Name; + context.CopyDirectory(d, Path.Combine(resourceTargetDir, dirName)); + context.Information($"Copy directory: FROM {d} TO {Path.Combine(resourceTargetDir, dirName)}"); + } + } + } +} diff --git a/src/MeoAssistantBuilder/Helper/GetBuildInformationHelper.cs b/src/MeoAssistantBuilder/Helper/GetBuildInformationHelper.cs new file mode 100644 index 0000000000..ac87a4c998 --- /dev/null +++ b/src/MeoAssistantBuilder/Helper/GetBuildInformationHelper.cs @@ -0,0 +1,38 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; + +namespace MeoAssistantBuilder.Helper; + +public static class GetBuildInformationHelper +{ + public static (string, string) GetBuildInformation(this MaaBuildContext context) + { + var ghAction = context.GitHubActions(); + + var buildTime = DateTime.UtcNow.AddHours(8); + var bt = buildTime.ToString("yyyy-MM-dd-HH-mm-ss"); + string hash; + + if (ghAction.IsRunningOnGitHubActions) + { + hash = ghAction.Environment.Workflow.Sha.ToLower()[..7]; + } + else + { + try + { + var realPath = new DirectoryInfo(Constants.MaaProjectRootDirectory).FullName; + var repo = new LibGit2Sharp.Repository(realPath); + var commit = repo.Commits.First(); + hash = commit.Sha.ToLower()[..7]; + } + catch (Exception e) + { + context.Warning($"Failed to get git log: {e.Message}"); + hash = "Unknown"; + } + } + + return (bt, hash); + } +} diff --git a/src/MeoAssistantBuilder/MaaBuildContext.cs b/src/MeoAssistantBuilder/MaaBuildContext.cs new file mode 100644 index 0000000000..01044eed84 --- /dev/null +++ b/src/MeoAssistantBuilder/MaaBuildContext.cs @@ -0,0 +1,28 @@ +using Cake.Common; +using Cake.Common.Tools.VSWhere; +using Cake.Core; +using Cake.Core.Diagnostics; +using Cake.Frosting; + +namespace MeoAssistantBuilder; + +public class MaaBuildContext : FrostingContext +{ + public string MsBuildExecutable { get; set; } + + public MaaBuildContext(ICakeContext context) : base(context) + { + MsBuildExecutable = context.Argument("tool", ""); + if (MsBuildExecutable == "") + { + var vsPath = context.VSWhereLatest(); + if (vsPath == null) + { + context.Log.Write(Verbosity.Normal, LogLevel.Fatal, "Can not find Visual Studio install path"); + System.Environment.Exit(-1); + } + MsBuildExecutable = Path.Combine(vsPath.FullPath, "Msbuild\\Current\\Bin\\MsBuild.exe"); + } + context.Log.Information($"Use MsBuild at: {MsBuildExecutable}"); + } +} diff --git a/src/MeoAssistantBuilder/MeoAssistantBuilder.csproj b/src/MeoAssistantBuilder/MeoAssistantBuilder.csproj new file mode 100644 index 0000000000..c8d02f6130 --- /dev/null +++ b/src/MeoAssistantBuilder/MeoAssistantBuilder.csproj @@ -0,0 +1,17 @@ + + + + Exe + net6.0 + enable + disable + x64 + Debug;Release;CICD + + + + + + + + diff --git a/src/MeoAssistantBuilder/Program.cs b/src/MeoAssistantBuilder/Program.cs new file mode 100644 index 0000000000..c14c37d4ef --- /dev/null +++ b/src/MeoAssistantBuilder/Program.cs @@ -0,0 +1,15 @@ +using Cake.Frosting; +using MeoAssistantBuilder; + +var sArgs = new List(); +foreach (var arg in args) +{ + var sa = arg.Split(" ") + .ToList(); + sa.RemoveAll(x => string.IsNullOrEmpty(x) || string.IsNullOrWhiteSpace(x)); + sArgs.AddRange(sa); +} + +return new CakeHost() + .UseContext() + .Run(sArgs); diff --git a/src/MeoAssistantBuilder/README.md b/src/MeoAssistantBuilder/README.md new file mode 100644 index 0000000000..c4288f5cd3 --- /dev/null +++ b/src/MeoAssistantBuilder/README.md @@ -0,0 +1,23 @@ +# MeoAssistantBuilder + +MAA 构建项目 + +## 构建 MAA + +需要安装 +- `.NET SDK 6.0` +- `.NET Framework SDK 4.8` +- `MSVC v143 x64` +- `MSBuild (VS2022)` + +在本项目根目录执行 +``` +dotnet run -- --target +``` + +TARGET 可选项 + +- `DevBuild` +- `ReleaseCore` +- `ReleaseWpf` +- `ReleaseResource` diff --git a/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs b/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs new file mode 100644 index 0000000000..fd5ae6ea8a --- /dev/null +++ b/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs @@ -0,0 +1,78 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; +using Cake.Frosting; +using MeoAssistantBuilder.Helper; +using System.IO.Compression; + +namespace MeoAssistantBuilder.Tasks; + +[TaskName("DevBuild")] +public sealed class DevBuildTask : FrostingTask +{ + public override void Run(MaaBuildContext context) + { + context.Information("--------------------------------------------------"); + context.Information("1. Get build information"); + context.Information("--------------------------------------------------"); + + context.CleanArtifacts(); + var (bt, hash) = context.GetBuildInformation(); + var artifact = $"MaaFull-DevBuild-(CONF)-{hash}-{bt}.zip"; + context.Information($"Dev build of commit {hash} at {bt}"); + + context.Information("--------------------------------------------------"); + context.Information("2. Build MaaFull with configuration Release"); + context.Information("--------------------------------------------------"); + + context.CleanAll(); + + context.BuildCore("Release"); + context.BuildWpf("Release"); + var releaseOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "Release"); + var releaseArtifact = Path.Combine(Constants.MaaProjectArtifactDirectory, artifact.Replace("(CONF)", "Release")); + ZipFile.CreateFromDirectory(releaseOutput, releaseArtifact); + + context.Information("--------------------------------------------------"); + context.Information("3. Build MaaFull with configuration RelWithDebInfo"); + context.Information("--------------------------------------------------"); + + context.CleanAll(); + + context.BuildCore("RelWithDebInfo"); + context.BuildWpf("RelWithDebInfo"); + var releaseDebugOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "RelWithDebInfo"); + var releaseDebugArtifact = Path.Combine(Constants.MaaProjectArtifactDirectory, artifact.Replace("(CONF)", "RelWithDebInfo")); + ZipFile.CreateFromDirectory(releaseDebugOutput, releaseDebugArtifact); + + context.Information("--------------------------------------------------"); + context.Information("4. Build MaaFull with configuration CICD"); + context.Information("--------------------------------------------------"); + + context.CleanAll(); + + context.BuildCore("CICD"); + context.BuildWpf("CICD"); + var releaseCiOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "CICD"); + var releaseCiArtifact = Path.Combine(Constants.MaaProjectArtifactDirectory, artifact.Replace("(CONF)", "CICD")); + context.CopyThirdPartyDlls(releaseCiOutput); + context.CopyResources(releaseCiOutput); + ZipFile.CreateFromDirectory(releaseCiOutput, releaseCiArtifact); + + context.Information("--------------------------------------------------"); + context.Information("5. Upload Artifacts"); + context.Information("--------------------------------------------------"); + + var gh = context.GitHubActions(); + if (gh.IsRunningOnGitHubActions) + { + context.Information("Upload artifacts to GitHub Actions"); + gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(releaseArtifact), artifact.Replace("(CONF)", "Release")).Wait(); + gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(releaseDebugArtifact), artifact.Replace("(CONF)", "RelWithDebInfo")).Wait(); + gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(releaseCiArtifact), artifact.Replace("(CONF)", "CICD")).Wait(); + } + else + { + context.Information("Skip"); + } + } +} diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs new file mode 100644 index 0000000000..f2e39cb757 --- /dev/null +++ b/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs @@ -0,0 +1,102 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; +using Cake.Frosting; +using MeoAssistantBuilder.Helper; +using System.IO.Compression; +using System.Text.RegularExpressions; + +namespace MeoAssistantBuilder.Tasks; + +[TaskName("ReleaseCore")] +public sealed class ReleaseCoreTask : FrostingTask +{ + public override void Run(MaaBuildContext context) + { + context.Information("--------------------------------------------------"); + context.Information("1. Build MaaCore with CICD configuration"); + context.Information("--------------------------------------------------"); + + context.CleanCore(); + context.CleanArtifacts(); + context.BuildCore("CICD"); + + context.Information("--------------------------------------------------"); + context.Information("2. Remove extra files from build output"); + context.Information("--------------------------------------------------"); + + var buildOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "CICD"); + context.RemoveExtraCore(buildOutput); + + context.Information("--------------------------------------------------"); + context.Information("3. Copy 3rd party library DLLs to output directory"); + context.Information("--------------------------------------------------"); + + var thirdPartyDlls = Directory.GetFiles(Path.Combine(Constants.MaaProjectThirdPartyDirectory, "bin")); + foreach(var f in thirdPartyDlls) + { + var fileName = new FileInfo(f).Name; + File.Copy(f, Path.Combine(buildOutput, fileName)); + context.Information($"Copy file: FROM {f} to {Path.Combine(buildOutput, fileName)}"); + } + + context.Information("--------------------------------------------------"); + context.Information("4. Read MaaCore version string"); + context.Information("--------------------------------------------------"); + + var version = "UNKNOWN"; + var versionFile = Path.Combine(Constants.MaaCoreProjectDirectory, "Version.h"); + var versionFileContent = File.ReadAllText(versionFile); + + var regex = @"v((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)"; + + var match = Regex.Match(versionFileContent, regex); + if (match.Success is false) + { + context.Warning("Can not read version"); + Environment.Exit(-1); + } + else + { + version = match.Value; + } + + var ghActions = context.GitHubActions(); + if (ghActions.IsRunningOnGitHubActions is false) + { + version += "-Local"; + } + else + { + if (ghActions.Environment.Workflow.Workflow != "Release MaaCore") + { + version += $"-{ghActions.Environment.Workflow.RunId}"; + } + } + + context.Information($"MaaCore Version: {version}"); + + context.Information("--------------------------------------------------"); + context.Information("5. Bundle MaaCore DLLs"); + context.Information("--------------------------------------------------"); + + var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaCore-{version}.zip"); + ZipFile.CreateFromDirectory(buildOutput, bundle); + + context.Information($"Bundled MAACore DLLs file: {bundle}"); + + context.Information("--------------------------------------------------"); + context.Information("6. Upload Artifact"); + context.Information("--------------------------------------------------"); + + var gh = context.GitHubActions(); + if (gh.IsRunningOnGitHubActions) + { + context.Information("Upload artifacts to GitHub Actions"); + gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(bundle), $"MaaCore-{version}.zip").Wait(); + } + else + { + context.Information("Skip"); + } + } +} diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs new file mode 100644 index 0000000000..e73b1cd893 --- /dev/null +++ b/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs @@ -0,0 +1,58 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; +using Cake.Frosting; +using MeoAssistantBuilder.Helper; +using System.IO.Compression; + +namespace MeoAssistantBuilder.Tasks; + +[TaskName("ReleaseResource")] +public sealed class ReleaseResourceTask : FrostingTask +{ + public override void Run(MaaBuildContext context) + { + context.Information("--------------------------------------------------"); + context.Information("1. Get bundle information"); + context.Information("--------------------------------------------------"); + + var (hash, bt) = context.GetBuildInformation(); + context.CleanArtifacts(); + var version = $"{hash}-{bt}"; + context.Information($"MaaResource Version: {version}"); + + context.Information("--------------------------------------------------"); + context.Information("2. Copy MaaResource"); + context.Information("--------------------------------------------------"); + + var resDir = Path.Combine(Constants.MaaBuildOutputDirectory, "resource"); + if (Directory.Exists(resDir) is false) + { + Directory.CreateDirectory(resDir); + } + context.CopyResources(resDir); + + context.Information("--------------------------------------------------"); + context.Information("3. Bundle MaaResource"); + context.Information("--------------------------------------------------"); + + var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaResource-{version}.zip"); + ZipFile.CreateFromDirectory(resDir, bundle); + + context.Information($"Bundled MaaResource file: {bundle}"); + + context.Information("--------------------------------------------------"); + context.Information("4. Upload Artifact"); + context.Information("--------------------------------------------------"); + + var gh = context.GitHubActions(); + if (gh.IsRunningOnGitHubActions) + { + context.Information("Upload artifacts to GitHub Actions"); + gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(bundle), $"MaaResource-{version}.zip").Wait(); + } + else + { + context.Information("Skip"); + } + } +} diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs new file mode 100644 index 0000000000..681bc85f3a --- /dev/null +++ b/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs @@ -0,0 +1,61 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; +using Cake.Frosting; +using MeoAssistantBuilder.Helper; +using System.IO.Compression; + +namespace MeoAssistantBuilder.Tasks; + +[TaskName("ReleaseWpf")] +public sealed class ReleaseWpfTask : FrostingTask +{ + public override void Run(MaaBuildContext context) + { + context.Information("--------------------------------------------------"); + context.Information("1. Build MaaWpf with ReleaseCore configuration"); + context.Information("--------------------------------------------------"); + + var (hash, bt) = context.GetBuildInformation(); + context.CleanWpf(); + context.CleanArtifacts(); + context.BuildWpf("CICD"); + + context.Information("--------------------------------------------------"); + context.Information("2. Remove extra files from build output"); + context.Information("--------------------------------------------------"); + + var buildOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "CICD"); + context.RemoveExtraWpf(buildOutput); + + context.Information("--------------------------------------------------"); + context.Information("3. Set MaaWpf Version Number"); + context.Information("--------------------------------------------------"); + + var version = $"{hash}-{bt}"; + context.Information($"MaaWpf Version: {version}"); + + context.Information("--------------------------------------------------"); + context.Information("4. Bundle MaaWpf Executables"); + context.Information("--------------------------------------------------"); + + var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaWpf-{version}.zip"); + ZipFile.CreateFromDirectory(buildOutput, bundle); + + context.Information($"Bundled MaaWpf Executables file: {bundle}"); + + context.Information("--------------------------------------------------"); + context.Information("5. Upload Artifact"); + context.Information("--------------------------------------------------"); + + var gh = context.GitHubActions(); + if (gh.IsRunningOnGitHubActions) + { + context.Information("Upload artifacts to GitHub Actions"); + gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(bundle), $"MaaWpf-{version}.zip").Wait(); + } + else + { + context.Information("Skip"); + } + } +} From b21f9e54f5a0ed987b10079d9b5c59435a0464c3 Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 13:06:12 +0800 Subject: [PATCH 07/24] =?UTF-8?q?ci.=E6=B7=BB=E5=8A=A0=20DevBuild=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-dev-build.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/maa-dev-build.yaml diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml new file mode 100644 index 0000000000..9b3964d354 --- /dev/null +++ b/.github/workflows/maa-dev-build.yaml @@ -0,0 +1,21 @@ +name: "Maa Dev Build" + +on: + push: + pull_request: + +jobs: + build: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + - name: Goto MeoAssistantBuilder source directory + run: cd ./src/MeoAssistantBuilder + - name: Run dev build task + run: dotnet run -- --target DevBuild From 3024082dff01293a60a9c3db65a1717d0b3f15af Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 13:12:41 +0800 Subject: [PATCH 08/24] =?UTF-8?q?ci.=E4=BF=AE=20Ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-dev-build.yaml | 9 +++++---- ci-dev-build.ps1 | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 ci-dev-build.ps1 diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml index 9b3964d354..f2197e2e3a 100644 --- a/.github/workflows/maa-dev-build.yaml +++ b/.github/workflows/maa-dev-build.yaml @@ -10,12 +10,13 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Setup .NET 6.0.x uses: actions/setup-dotnet@v2 with: dotnet-version: 6.0.x - - name: Goto MeoAssistantBuilder source directory - run: cd ./src/MeoAssistantBuilder + - name: Run dev build task - run: dotnet run -- --target DevBuild + run: pwsh .\ci-dev-build.ps1 diff --git a/ci-dev-build.ps1 b/ci-dev-build.ps1 new file mode 100644 index 0000000000..ffb7496e54 --- /dev/null +++ b/ci-dev-build.ps1 @@ -0,0 +1,2 @@ +Set-Location .\src\MeoAssistantBuilder +dotnet run -- --target DevBuild From 0e5914439000c49e59c8fdf3a3b836bfdc1cafb8 Mon Sep 17 00:00:00 2001 From: Alisa Date: Mon, 9 May 2022 13:45:00 +0800 Subject: [PATCH 09/24] =?UTF-8?q?ci.=E4=BF=AE=E5=A4=8D=20CI=20=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=20Artifact=20=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-dev-build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml index f2197e2e3a..057782f93a 100644 --- a/.github/workflows/maa-dev-build.yaml +++ b/.github/workflows/maa-dev-build.yaml @@ -20,3 +20,5 @@ jobs: - name: Run dev build task run: pwsh .\ci-dev-build.ps1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 36df5262813b0d15e1bed25adfd893a75a5e204f Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 14:04:11 +0800 Subject: [PATCH 10/24] =?UTF-8?q?ci.=E4=BF=AE=E6=94=B9=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20GitHub=20Action=20=E7=9A=84=20Upload=20Artifacts=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-dev-build.yaml | 8 ++++++-- src/MeoAssistantBuilder/Tasks/DevBuildTask.cs | 17 ----------------- .../Tasks/ReleaseCoreTask.cs | 15 --------------- .../Tasks/ReleaseResourceTask.cs | 15 --------------- src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs | 15 --------------- 5 files changed, 6 insertions(+), 64 deletions(-) diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml index 057782f93a..63fb758d0d 100644 --- a/.github/workflows/maa-dev-build.yaml +++ b/.github/workflows/maa-dev-build.yaml @@ -20,5 +20,9 @@ jobs: - name: Run dev build task run: pwsh .\ci-dev-build.ps1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: Dev Build Bundles + path: ./artifacts diff --git a/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs b/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs index fd5ae6ea8a..0f8d93616b 100644 --- a/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs +++ b/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs @@ -57,22 +57,5 @@ public sealed class DevBuildTask : FrostingTask context.CopyThirdPartyDlls(releaseCiOutput); context.CopyResources(releaseCiOutput); ZipFile.CreateFromDirectory(releaseCiOutput, releaseCiArtifact); - - context.Information("--------------------------------------------------"); - context.Information("5. Upload Artifacts"); - context.Information("--------------------------------------------------"); - - var gh = context.GitHubActions(); - if (gh.IsRunningOnGitHubActions) - { - context.Information("Upload artifacts to GitHub Actions"); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(releaseArtifact), artifact.Replace("(CONF)", "Release")).Wait(); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(releaseDebugArtifact), artifact.Replace("(CONF)", "RelWithDebInfo")).Wait(); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(releaseCiArtifact), artifact.Replace("(CONF)", "CICD")).Wait(); - } - else - { - context.Information("Skip"); - } } } diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs index f2e39cb757..27d2f0df99 100644 --- a/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs +++ b/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs @@ -83,20 +83,5 @@ public sealed class ReleaseCoreTask : FrostingTask ZipFile.CreateFromDirectory(buildOutput, bundle); context.Information($"Bundled MAACore DLLs file: {bundle}"); - - context.Information("--------------------------------------------------"); - context.Information("6. Upload Artifact"); - context.Information("--------------------------------------------------"); - - var gh = context.GitHubActions(); - if (gh.IsRunningOnGitHubActions) - { - context.Information("Upload artifacts to GitHub Actions"); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(bundle), $"MaaCore-{version}.zip").Wait(); - } - else - { - context.Information("Skip"); - } } } diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs index e73b1cd893..de89df2d60 100644 --- a/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs +++ b/src/MeoAssistantBuilder/Tasks/ReleaseResourceTask.cs @@ -39,20 +39,5 @@ public sealed class ReleaseResourceTask : FrostingTask ZipFile.CreateFromDirectory(resDir, bundle); context.Information($"Bundled MaaResource file: {bundle}"); - - context.Information("--------------------------------------------------"); - context.Information("4. Upload Artifact"); - context.Information("--------------------------------------------------"); - - var gh = context.GitHubActions(); - if (gh.IsRunningOnGitHubActions) - { - context.Information("Upload artifacts to GitHub Actions"); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(bundle), $"MaaResource-{version}.zip").Wait(); - } - else - { - context.Information("Skip"); - } } } diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs index 681bc85f3a..43b7ceb0b9 100644 --- a/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs +++ b/src/MeoAssistantBuilder/Tasks/ReleaseWpfTask.cs @@ -42,20 +42,5 @@ public sealed class ReleaseWpfTask : FrostingTask ZipFile.CreateFromDirectory(buildOutput, bundle); context.Information($"Bundled MaaWpf Executables file: {bundle}"); - - context.Information("--------------------------------------------------"); - context.Information("5. Upload Artifact"); - context.Information("--------------------------------------------------"); - - var gh = context.GitHubActions(); - if (gh.IsRunningOnGitHubActions) - { - context.Information("Upload artifacts to GitHub Actions"); - gh.Commands.UploadArtifact(Cake.Core.IO.FilePath.FromString(bundle), $"MaaWpf-{version}.zip").Wait(); - } - else - { - context.Information("Skip"); - } } } From 1c4832b61b6f05f5ee6d0c877962c4a4620f074d Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 14:27:22 +0800 Subject: [PATCH 11/24] =?UTF-8?q?ci.=E5=88=86=E5=BC=80=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=9A=84=20Artifacts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-dev-build.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml index 63fb758d0d..b5564ab2c3 100644 --- a/.github/workflows/maa-dev-build.yaml +++ b/.github/workflows/maa-dev-build.yaml @@ -21,8 +21,20 @@ jobs: - name: Run dev build task run: pwsh .\ci-dev-build.ps1 - - name: Upload Artifacts + - name: Upload Artifacts Release uses: actions/upload-artifact@v3 with: - name: Dev Build Bundles - path: ./artifacts + name: MaaFull-DevBuild-Release + path: ./artifacts/MaaFull-DevBuild-Release* + + - name: Upload Artifacts RelWithDebInfo + uses: actions/upload-artifact@v3 + with: + name: MaaFull-DevBuild-RelWithDebInfo + path: ./artifacts/MaaFull-DevBuild-RelWithDebInfo* + + - name: Upload Artifacts CICD + uses: actions/upload-artifact@v3 + with: + name: MaaFull-DevBuild-CICD + path: ./artifacts/MaaFull-DevBuild-CICD* From bcd749f1f7fb1d83ba60dc027ff73534cac7221d Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 15:58:57 +0800 Subject: [PATCH 12/24] =?UTF-8?q?ci.=E4=BC=98=E5=8C=96=20DevBuild?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-dev-build.yaml | 5 +---- build.ps1 | 16 ++++++++++++++++ ci-dev-build.ps1 | 2 -- 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 build.ps1 delete mode 100644 ci-dev-build.ps1 diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml index b5564ab2c3..30169a7971 100644 --- a/.github/workflows/maa-dev-build.yaml +++ b/.github/workflows/maa-dev-build.yaml @@ -19,22 +19,19 @@ jobs: dotnet-version: 6.0.x - name: Run dev build task - run: pwsh .\ci-dev-build.ps1 + run: pwsh .\build.ps1 DevBuild - name: Upload Artifacts Release uses: actions/upload-artifact@v3 with: - name: MaaFull-DevBuild-Release path: ./artifacts/MaaFull-DevBuild-Release* - name: Upload Artifacts RelWithDebInfo uses: actions/upload-artifact@v3 with: - name: MaaFull-DevBuild-RelWithDebInfo path: ./artifacts/MaaFull-DevBuild-RelWithDebInfo* - name: Upload Artifacts CICD uses: actions/upload-artifact@v3 with: - name: MaaFull-DevBuild-CICD path: ./artifacts/MaaFull-DevBuild-CICD* diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000000..c3b9466100 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,16 @@ +if ($args.Length -ne 1) { + throw "One argument required" +} + +$target = $args[0] +$valid_targets = @("ReleaseCore", "ReleaseWpf", "ReleaseResource", "DevBuild") + +if (!$valid_targets.Contains($target)) { + throw "$target is not a valid target" +} + +Set-Location -Path .\src\MeoAssistantBuilder + +dotnet run -- --target $target + +Set-Location -Path ..\..\ diff --git a/ci-dev-build.ps1 b/ci-dev-build.ps1 deleted file mode 100644 index ffb7496e54..0000000000 --- a/ci-dev-build.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -Set-Location .\src\MeoAssistantBuilder -dotnet run -- --target DevBuild From 400fc9df8f66060845a4fcb5aa25142422e2c8f5 Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 16:51:24 +0800 Subject: [PATCH 13/24] =?UTF-8?q?ci.=E6=B7=BB=E5=8A=A0=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-dev-build.yaml | 6 +++ .github/workflows/maa-doc-azure-deploy.yaml | 60 ++++++++++----------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml index 30169a7971..fa58c41fb0 100644 --- a/.github/workflows/maa-dev-build.yaml +++ b/.github/workflows/maa-dev-build.yaml @@ -2,7 +2,10 @@ name: "Maa Dev Build" on: push: + branches: + - master pull_request: + workflow_dispatch: jobs: build: @@ -24,14 +27,17 @@ jobs: - name: Upload Artifacts Release uses: actions/upload-artifact@v3 with: + name: MaaFull-DevBuild-Release path: ./artifacts/MaaFull-DevBuild-Release* - name: Upload Artifacts RelWithDebInfo uses: actions/upload-artifact@v3 with: + name: MaaFull-DevBuild-RelWithDebInfo path: ./artifacts/MaaFull-DevBuild-RelWithDebInfo* - name: Upload Artifacts CICD uses: actions/upload-artifact@v3 with: + name: MaaFull-DevBuild-CICD path: ./artifacts/MaaFull-DevBuild-CICD* diff --git a/.github/workflows/maa-doc-azure-deploy.yaml b/.github/workflows/maa-doc-azure-deploy.yaml index f71103aa47..83b47e6832 100644 --- a/.github/workflows/maa-doc-azure-deploy.yaml +++ b/.github/workflows/maa-doc-azure-deploy.yaml @@ -1,30 +1,30 @@ -name: Azure Static Web Apps CI/CD - -on: - push: - branches: - - master - paths: - - "docs/*" - -jobs: - build_and_deploy: - runs-on: ubuntu-latest - name: Build and Deploy Job - if: github.repository_owner == 'MaaAssistantArknights' - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: Build And Deploy - id: builddeploy - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_DESERT_00290F400 }} - repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) - action: "upload" - ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### - # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig - app_location: "/docs" # App source code path - api_location: "" # Api source code path - optional - output_location: ".vuepress/dist" # Built app content directory - optional +name: Deploy Docs + +on: + push: + branches: + - master + paths: + - "docs/*" + workflow_dispatch: + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GENTLE_DESERT_00290F400 }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: "/docs" # App source code path + api_location: "" # Api source code path - optional + output_location: ".vuepress/dist" # Built app content directory - optional From 315d37b411a2abadb4e3ad211dcfbfb15f02099c Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 17:20:36 +0800 Subject: [PATCH 14/24] =?UTF-8?q?ci.=E6=B7=BB=E5=8A=A0=20ReleaseCore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-release-core.yaml | 44 +++++++++++++ .../Tasks/ReleaseCoreTask.cs | 66 +++++++++++-------- 2 files changed, 82 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/maa-release-core.yaml diff --git a/.github/workflows/maa-release-core.yaml b/.github/workflows/maa-release-core.yaml new file mode 100644 index 0000000000..d17e2061c6 --- /dev/null +++ b/.github/workflows/maa-release-core.yaml @@ -0,0 +1,44 @@ +name: Release MaaCore + +on: + release: + types: + - published + +jobs: + + release-core: + + runs-on: windows-latest + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Get tag + id: tag + uses: dawidd6/action-get-tag@v1 + + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Run release core task + run: pwsh .\build.ps1 ReleaseCore + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: MaaCore-${{ steps.tag.outputs.tag }} + path: ./artifacts/MaaCore* + + - name: Upload release assets + uses: xresloader/upload-to-github-release@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + file: ./artifacts/MaaCore* + tags: true + verbose: true diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs index 27d2f0df99..8a2131b5e4 100644 --- a/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs +++ b/src/MeoAssistantBuilder/Tasks/ReleaseCoreTask.cs @@ -13,34 +13,7 @@ public sealed class ReleaseCoreTask : FrostingTask public override void Run(MaaBuildContext context) { context.Information("--------------------------------------------------"); - context.Information("1. Build MaaCore with CICD configuration"); - context.Information("--------------------------------------------------"); - - context.CleanCore(); - context.CleanArtifacts(); - context.BuildCore("CICD"); - - context.Information("--------------------------------------------------"); - context.Information("2. Remove extra files from build output"); - context.Information("--------------------------------------------------"); - - var buildOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "CICD"); - context.RemoveExtraCore(buildOutput); - - context.Information("--------------------------------------------------"); - context.Information("3. Copy 3rd party library DLLs to output directory"); - context.Information("--------------------------------------------------"); - - var thirdPartyDlls = Directory.GetFiles(Path.Combine(Constants.MaaProjectThirdPartyDirectory, "bin")); - foreach(var f in thirdPartyDlls) - { - var fileName = new FileInfo(f).Name; - File.Copy(f, Path.Combine(buildOutput, fileName)); - context.Information($"Copy file: FROM {f} to {Path.Combine(buildOutput, fileName)}"); - } - - context.Information("--------------------------------------------------"); - context.Information("4. Read MaaCore version string"); + context.Information("1. Read MaaCore version string"); context.Information("--------------------------------------------------"); var version = "UNKNOWN"; @@ -67,14 +40,51 @@ public sealed class ReleaseCoreTask : FrostingTask } else { + context.Information($"Running in GitHub Action with workflow name: {ghActions.Environment.Workflow.Workflow}, ref: {ghActions.Environment.Workflow.Ref}"); if (ghActions.Environment.Workflow.Workflow != "Release MaaCore") { version += $"-{ghActions.Environment.Workflow.RunId}"; } + else + { + var tag = ghActions.Environment.Workflow.Ref.Replace("refs/tags/", ""); + if (tag != version) + { + context.Error($"Version do not match. From File: {version}. From Ref: {tag}"); + Environment.Exit(-1); + } + } } context.Information($"MaaCore Version: {version}"); + context.Information("--------------------------------------------------"); + context.Information("2. Build MaaCore with CICD configuration"); + context.Information("--------------------------------------------------"); + + context.CleanCore(); + context.CleanArtifacts(); + context.BuildCore("CICD"); + + context.Information("--------------------------------------------------"); + context.Information("3. Remove extra files from build output"); + context.Information("--------------------------------------------------"); + + var buildOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "CICD"); + context.RemoveExtraCore(buildOutput); + + context.Information("--------------------------------------------------"); + context.Information("4. Copy 3rd party library DLLs to output directory"); + context.Information("--------------------------------------------------"); + + var thirdPartyDlls = Directory.GetFiles(Path.Combine(Constants.MaaProjectThirdPartyDirectory, "bin")); + foreach(var f in thirdPartyDlls) + { + var fileName = new FileInfo(f).Name; + File.Copy(f, Path.Combine(buildOutput, fileName)); + context.Information($"Copy file: FROM {f} to {Path.Combine(buildOutput, fileName)}"); + } + context.Information("--------------------------------------------------"); context.Information("5. Bundle MaaCore DLLs"); context.Information("--------------------------------------------------"); From 3d1209564b879365c6b755ece3438633afe631e5 Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 18:21:57 +0800 Subject: [PATCH 15/24] =?UTF-8?q?ci.=E4=BF=AE=E6=94=B9=20ReleaseCore=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-release-core.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/maa-release-core.yaml b/.github/workflows/maa-release-core.yaml index d17e2061c6..c8735c956f 100644 --- a/.github/workflows/maa-release-core.yaml +++ b/.github/workflows/maa-release-core.yaml @@ -41,4 +41,5 @@ jobs: with: file: ./artifacts/MaaCore* tags: true + draft: false verbose: true From 96094312acc1e9ccf024b01e81326b524ef15348 Mon Sep 17 00:00:00 2001 From: ABA2396 <2396806385@qq.com> Date: Mon, 9 May 2022 19:05:52 +0800 Subject: [PATCH 16/24] =?UTF-8?q?feat.=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=9F=BF?= =?UTF-8?q?=E5=8C=BA=E5=BC=80=E9=87=87=E5=92=8C=E9=99=90=E5=AE=9A=E5=AF=BB?= =?UTF-8?q?=E8=AE=BF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/tasks.json | 199 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) diff --git a/resource/tasks.json b/resource/tasks.json index 38c8f90beb..8ade90cc5d 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -1736,6 +1736,205 @@ "RecruitNowConfirm" ] }, + "ActivitiesBegin": { + "algorithm": "justreturn", + "action": "doNothing", + "next": [ + "ReturnToActivities", + "MiningActivities", + "RecruitingActivities" + ] + }, + "ReturnToActivities": { + "template": "Return.png", + "action": "clickSelf", + "roi": [ + 0, + 0, + 180, + 80 + ], + "next": [ + "ReturnToActivities", + "MiningActivities", + "RecruitingActivities", + "Stop" + ] + }, + "MiningActivities": { + "algorithm": "OcrDetect", + "text": [ + "限时开采", + "开采" + ], + "action": "clickSelf", + "roi": [ + 0, + 20, + 302, + 302 + ], + "next": [ + "MiningActivityDigging", + "MiningActivitiesReturn" + ] + }, + "MiningActivityDigging": { + "action": "clickSelf", + "roi": [ + 901, + 469, + 334, + 182 + ], + "next": [ + "MiningActivityDigging", + "MiningActivityDiggingEnd", + "MiningActivitiesReturn" + ] + }, + "MiningActivityDiggingEnd": { + "action": "clickSelf", + "roi": [ + 559, + 563, + 160, + 157 + ], + "next": [ + "MiningActivitiesReturn" + ] + }, + "MiningActivitiesReturn": { + "template": "CloseAnno.png", + "action": "clickSelf", + "roi": [ + 1146, + 0, + 134, + 162 + ], + "next": [ + "RecruitingActivities", + "MiningActivitiesReturn", + "Stop" + ] + }, + "RecruitingActivities": { + "algorithm": "OcrDetect", + "text": [ + "赠送", + "次" + ], + "action": "clickSelf", + "roi": [ + 1148, + 416, + 132, + 138 + ], + "next": [ + "RecruitingActivitiesConfirm", + "RecruitingActivities" + ] + }, + "RecruitingActivitiesConfirm": { + "action": "doNothing", + "algorithm": "OcrDetect", + "text": [ + "赠送", + "次", + "小时" + ], + "roi": [ + 729, + 515, + 303, + 135 + ], + "next": [ + "RecruitingActivitiesRecruit", + "RecruitingActivitiesConfirm" + ] + }, + "RecruitingActivitiesRecruit": { + "algorithm": "OcrDetect", + "action": "clickSelf", + "text": [ + "寻访一次", + "寻访" + ], + "roi": [ + 770, + 577, + 267, + 143 + ], + "next": [ + "RecruitingActivitiesRecruitNowConfirm" + ] + }, + "RecruitingActivitiesRecruitNowConfirm": { + "action": "clickSelf", + "template": "RecruitNowConfirm.png", + "roi": [ + 586, + 399, + 694, + 192 + ], + "next": [ + "RecruitingActivitiesRecruitSkip", + "RecruitingActivitiesRecruitSkipWithoutButton", + "RecruitingActivitiesRecruitNowConfirm" + ] + }, + "RecruitingActivitiesRecruitSkip": { + "action": "clickSelf", + "template": "RecruitSkip.png", + "roi": [ + 1100, + 0, + 180, + 150 + ], + "next": [ + "RecruitingActivitiesRecruitSkip", + "RecruitingActivitiesRecruitSkipWithoutButton" + ] + }, + "RecruitingActivitiesRecruitSkipWithoutButton": { + "action": "clickRect", + "algorithm": "justReturn", + "specificRect": [ + 1180, + 15, + 85, + 60 + ], + "next": [ + "RecruitingActivitiesRecruitEnd", + "RecruitingActivitiesRecruitSkip", + "RecruitingActivitiesRecruitSkipWithoutButton" + ] + }, + "RecruitingActivitiesRecruitEnd": { + "algorithm": "OcrDetect", + "action": "doNothing", + "text": [ + "寻访一次", + "寻访" + ], + "roi": [ + 770, + 577, + 267, + 143 + ], + "next": [ + "Stop" + ] + }, "AwardBegin": { "algorithm": "justreturn", "action": "doNothing", From 644c405e39b87511f0ae0cec5814639aa6577b9b Mon Sep 17 00:00:00 2001 From: ABA2396 <99072975+ABA2396@users.noreply.github.com> Date: Mon, 9 May 2022 19:21:22 +0800 Subject: [PATCH 17/24] =?UTF-8?q?feat.=E6=B7=BB=E5=8A=A0=E4=BA=86=E7=9F=BF?= =?UTF-8?q?=E5=8C=BA=E5=BC=80=E9=87=87=E5=92=8C=E9=99=90=E5=AE=9A=E5=AF=BB?= =?UTF-8?q?=E8=AE=BF=E5=8A=9F=E8=83=BD=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/template/MiningActivityDigging.png | Bin 0 -> 25607 bytes resource/template/MiningActivityDiggingEnd.png | Bin 0 -> 5645 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 resource/template/MiningActivityDigging.png create mode 100644 resource/template/MiningActivityDiggingEnd.png diff --git a/resource/template/MiningActivityDigging.png b/resource/template/MiningActivityDigging.png new file mode 100644 index 0000000000000000000000000000000000000000..386ef5063a0ebc6f65afe382e5b1b20ecc95f1de GIT binary patch literal 25607 zcmb@u2Ut_-);1i90wPi@ARsUpM35pPy(%bGP$2Yq|KpwP)}A`yncg<|G&n|kx{9ZN@! z(nQ|idzd6*){%TIO_bqd-NPrIeDuk8+(%a`Vf4p+*hB`)$-&vg&mf^w4+RAH}MLC6AilrycBqq^nzB|V% zB(ODFV3!qIMTNWCkf`!WdY_+KQ>d0|L{G>EH=x`ion+80r$f#E8ta;$QkfW9&b-nD z9Gptd>F`rPz8Kb4Wn8!inI5O8uf7s>LtR@4&&_((p0`?XYZa^BCT(-8eqw7~o%UqCzpMNaH`U9;`NNHoN7QLq_D4*Hq3V@5LJAx3!DZ)I8@#J_^~-zLM~?DG;Gg|= zin*QAd@=ZPrjer!iIE=U8GAUG96h3;#uguKYoo1YfW*ENjR|G_?1~1D9z8sNs$_Q! zbtG0>Xf*9^RwQ`q2CXe{iK9+gl#~=UTdrvOTtWUCCDvBpyyAhYx$zjx#~;XpLm6M< z2jS%Kz`1F@yLBFuqd*rI;NP^N(`=-2uwrlJz%I0EZ$yP7|c>m7_2HEzHJJK@Y zt}fIazA#ew@R_RJ=U=kmFjCgkK^tt*3pMFO$Aa&JmqxWYg%M1=!VVtpelB9yeM4_8 z;!acLGIBId0@fmZo9-k80m88uP>meDYj@$el+7;;mpi)Nj~w;AZ0Eos>ByDDcI^Vq zyUSI-yo*q=&0@fJ`Nw5{N@)e6(FMfDjM|;%-NWMv7h8enfP5Btv`F)1-K;7fHIam@ zpRS_P3a0`dE=+V10$;TnI@gkp-?iQT~X@zIJ`_sX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1-+zzCGN{9j^VMr*WRv#4FPNxTk z(VbX&v14$1oCck0->46Dhv8bB6#e9~m5q%LuGg!PF=F_ufEo}psGUHHcc#^^{Lmf| z#INldQj(k^ZqaOrH;X9@j=z=>U5@TfWlUScbTGyV42~QWGD`4m2{ZB4VEcpAz#tlJ zg;Ak)5MgV_y?EeAHK=~q?8rmzLFIGcR4O)yV}ElxI*`VIvq>m4^ceWJr~dI&0F#ed zhp^M3+Xw0}81^)fPDcN~6~y57pQtrUD8X)M*=7<7MI#szVMLw&6aj;QF{b+mzJ~_t u(2+D Date: Mon, 9 May 2022 21:03:40 +0800 Subject: [PATCH 18/24] =?UTF-8?q?ci.=E9=99=90=E5=AE=9A=20DevBuild=20?= =?UTF-8?q?=E7=9A=84=E7=94=9F=E6=95=88=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-dev-build.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml index fa58c41fb0..124abb8cf9 100644 --- a/.github/workflows/maa-dev-build.yaml +++ b/.github/workflows/maa-dev-build.yaml @@ -3,8 +3,22 @@ name: "Maa Dev Build" on: push: branches: - - master + - dev + paths: + - src/MeoAssistant/** + - src/MeoAssistantBuilder/** + - src/MeoAsstGui/** + - 3rdparty/** + - include/** + - MeoAssistantArknights.sln pull_request: + paths: + - src/MeoAssistant/** + - src/MeoAssistantBuilder/** + - src/MeoAsstGui/** + - 3rdparty/** + - include/** + - MeoAssistantArknights.sln workflow_dispatch: jobs: From f994e5cef6bb2d38813859072ea96d041785d39d Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 21:48:12 +0800 Subject: [PATCH 19/24] =?UTF-8?q?ci.=E6=B7=BB=E5=8A=A0=20MaaWpf=20?= =?UTF-8?q?=E5=92=8C=20MaaResource=20=E7=9A=84=20Release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-release-resource.yaml | 39 +++++++++++++++++++++ .github/workflows/maa-release-wpf.yaml | 38 ++++++++++++++++++++ read_path.ps1 | 16 +++++++++ 3 files changed, 93 insertions(+) create mode 100644 .github/workflows/maa-release-resource.yaml create mode 100644 .github/workflows/maa-release-wpf.yaml create mode 100644 read_path.ps1 diff --git a/.github/workflows/maa-release-resource.yaml b/.github/workflows/maa-release-resource.yaml new file mode 100644 index 0000000000..d68e94c4da --- /dev/null +++ b/.github/workflows/maa-release-resource.yaml @@ -0,0 +1,39 @@ +name: Release MaaResource + +on: + push: + branches: + - master + paths: + - resource/** + - 3rdparty/resource/** + workflow_dispatch: + +jobs: + + release-resource: + + runs-on: windows-latest + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Run release resource task + run: pwsh .\build.ps1 ReleaseResource + + - name: Read file name + id: read_path + run: pwsh .\read_path.ps1 ./artifacts MaaResource* + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.read_path.outputs.name_0 }} + path: ${{ steps.read_path.outputs.path_0 }} diff --git a/.github/workflows/maa-release-wpf.yaml b/.github/workflows/maa-release-wpf.yaml new file mode 100644 index 0000000000..6dadea0963 --- /dev/null +++ b/.github/workflows/maa-release-wpf.yaml @@ -0,0 +1,38 @@ +name: Release MaaWpf + +on: + push: + branches: + - master + paths: + - src/MeoAsstGui/** + workflow_dispatch: + +jobs: + + release-wpf: + + runs-on: windows-latest + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Run release wpf task + run: pwsh .\build.ps1 ReleaseWpf + + - name: Read file name + id: read_path + run: pwsh .\read_path.ps1 ./artifacts MaaWpf* + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.read_path.outputs.name_0 }} + path: ${{ steps.read_path.outputs.path_0 }} diff --git a/read_path.ps1 b/read_path.ps1 new file mode 100644 index 0000000000..6cfb1aaf0e --- /dev/null +++ b/read_path.ps1 @@ -0,0 +1,16 @@ +if ($args.Length -ne 2) { + throw "Need two arguments" +} + +$fs = Get-ChildItem -Path $args[0] -Filter $args[1] + +$index = 0 +foreach($f in $fs) { + + $name = $f.Name + $path = $f.FullName + Write-Output "::set-output name=name_$index::$name" + Write-Output "::set-output name=path_$index::$path" + + $index = $index + 1 +} From 0139745d0247c898e93269ee60728362b01b1097 Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 23:49:38 +0800 Subject: [PATCH 20/24] =?UTF-8?q?ci.=20=E9=87=8D=E5=91=BD=E5=90=8D=20Bundl?= =?UTF-8?q?e=20=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-dev-build.yaml | 26 +++++++++++-------- src/MeoAssistantBuilder/Tasks/DevBuildTask.cs | 8 +++--- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml index 124abb8cf9..f4e182094f 100644 --- a/.github/workflows/maa-dev-build.yaml +++ b/.github/workflows/maa-dev-build.yaml @@ -38,20 +38,24 @@ jobs: - name: Run dev build task run: pwsh .\build.ps1 DevBuild - - name: Upload Artifacts Release - uses: actions/upload-artifact@v3 - with: - name: MaaFull-DevBuild-Release - path: ./artifacts/MaaFull-DevBuild-Release* + - name: Read file name + id: read_path + run: pwsh .\read_path.ps1 ./artifacts MaaBundle - - name: Upload Artifacts RelWithDebInfo + - name: Upload Artifacts 0 uses: actions/upload-artifact@v3 with: - name: MaaFull-DevBuild-RelWithDebInfo - path: ./artifacts/MaaFull-DevBuild-RelWithDebInfo* + name: ${{ steps.read_path.outputs.name_0 }} + path: ${{ steps.read_path.outputs.path_0 }} - - name: Upload Artifacts CICD + - name: Upload Artifacts 1 uses: actions/upload-artifact@v3 with: - name: MaaFull-DevBuild-CICD - path: ./artifacts/MaaFull-DevBuild-CICD* + name: ${{ steps.read_path.outputs.name_1 }} + path: ${{ steps.read_path.outputs.path_1 }} + + - name: Upload Artifacts 2 + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.read_path.outputs.name_2 }} + path: ${{ steps.read_path.outputs.path_2 }} diff --git a/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs b/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs index 0f8d93616b..6b7ce804c7 100644 --- a/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs +++ b/src/MeoAssistantBuilder/Tasks/DevBuildTask.cs @@ -17,11 +17,11 @@ public sealed class DevBuildTask : FrostingTask context.CleanArtifacts(); var (bt, hash) = context.GetBuildInformation(); - var artifact = $"MaaFull-DevBuild-(CONF)-{hash}-{bt}.zip"; + var artifact = $"MaaBundle-DevBuild-(CONF)-{hash}-{bt}.zip"; context.Information($"Dev build of commit {hash} at {bt}"); context.Information("--------------------------------------------------"); - context.Information("2. Build MaaFull with configuration Release"); + context.Information("2. Build MaaBundle with configuration Release"); context.Information("--------------------------------------------------"); context.CleanAll(); @@ -33,7 +33,7 @@ public sealed class DevBuildTask : FrostingTask ZipFile.CreateFromDirectory(releaseOutput, releaseArtifact); context.Information("--------------------------------------------------"); - context.Information("3. Build MaaFull with configuration RelWithDebInfo"); + context.Information("3. Build MaaBundle with configuration RelWithDebInfo"); context.Information("--------------------------------------------------"); context.CleanAll(); @@ -45,7 +45,7 @@ public sealed class DevBuildTask : FrostingTask ZipFile.CreateFromDirectory(releaseDebugOutput, releaseDebugArtifact); context.Information("--------------------------------------------------"); - context.Information("4. Build MaaFull with configuration CICD"); + context.Information("4. Build MaaBundle with configuration CICD"); context.Information("--------------------------------------------------"); context.CleanAll(); From 3f52a6f2f75d15d6edb5bb71a699347c84bfba38 Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Mon, 9 May 2022 23:50:05 +0800 Subject: [PATCH 21/24] =?UTF-8?q?ci.=E6=B7=BB=E5=8A=A0=20MaaBundle=20?= =?UTF-8?q?=E7=9A=84=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-release-bundle.yaml | 45 ++++++++++ build.ps1 | 2 +- .../Tasks/ReleaseBundleTask.cs | 88 +++++++++++++++++++ 3 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/maa-release-bundle.yaml create mode 100644 src/MeoAssistantBuilder/Tasks/ReleaseBundleTask.cs diff --git a/.github/workflows/maa-release-bundle.yaml b/.github/workflows/maa-release-bundle.yaml new file mode 100644 index 0000000000..eb25aaa7f0 --- /dev/null +++ b/.github/workflows/maa-release-bundle.yaml @@ -0,0 +1,45 @@ +name: Release MaaBundle + +on: + release: + types: + - published + +jobs: + + release-bundle: + + runs-on: windows-latest + + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Get tag + id: tag + uses: dawidd6/action-get-tag@v1 + + - name: Setup .NET 6.0.x + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Run release core task + run: pwsh .\build.ps1 ReleaseBundle + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: MaaBundle-${{ steps.tag.outputs.tag }} + path: ./artifacts/MaaBundle* + + - name: Upload release assets + uses: xresloader/upload-to-github-release@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + file: ./artifacts/MaaBundle* + tags: true + draft: false + verbose: true diff --git a/build.ps1 b/build.ps1 index c3b9466100..ee59fbc4fe 100644 --- a/build.ps1 +++ b/build.ps1 @@ -3,7 +3,7 @@ if ($args.Length -ne 1) { } $target = $args[0] -$valid_targets = @("ReleaseCore", "ReleaseWpf", "ReleaseResource", "DevBuild") +$valid_targets = @("ReleaseCore", "ReleaseWpf", "ReleaseResource", "ReleaseBundle", "DevBuild") if (!$valid_targets.Contains($target)) { throw "$target is not a valid target" diff --git a/src/MeoAssistantBuilder/Tasks/ReleaseBundleTask.cs b/src/MeoAssistantBuilder/Tasks/ReleaseBundleTask.cs new file mode 100644 index 0000000000..1a75549b30 --- /dev/null +++ b/src/MeoAssistantBuilder/Tasks/ReleaseBundleTask.cs @@ -0,0 +1,88 @@ +using Cake.Common.Build; +using Cake.Common.Diagnostics; +using Cake.Frosting; +using MeoAssistantBuilder.Helper; +using System.IO.Compression; +using System.Text.RegularExpressions; + +namespace MeoAssistantBuilder.Tasks; + +[TaskName("ReleaseBundle")] +public sealed class ReleaseBundleTask : FrostingTask +{ + public override void Run(MaaBuildContext context) + { + context.Information("--------------------------------------------------"); + context.Information("1. Read MaaCore version string"); + context.Information("--------------------------------------------------"); + + var version = "UNKNOWN"; + var versionFile = Path.Combine(Constants.MaaCoreProjectDirectory, "Version.h"); + var versionFileContent = File.ReadAllText(versionFile); + + var regex = @"v((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)"; + + var match = Regex.Match(versionFileContent, regex); + if (match.Success is false) + { + context.Warning("Can not read version"); + Environment.Exit(-1); + } + else + { + version = match.Value; + } + + var ghActions = context.GitHubActions(); + if (ghActions.IsRunningOnGitHubActions is false) + { + version += "-Local"; + } + else + { + context.Information($"Running in GitHub Action with workflow name: {ghActions.Environment.Workflow.Workflow}, ref: {ghActions.Environment.Workflow.Ref}"); + if (ghActions.Environment.Workflow.Workflow != "Release MaaCore") + { + version += $"-{ghActions.Environment.Workflow.RunId}"; + } + else + { + var tag = ghActions.Environment.Workflow.Ref.Replace("refs/tags/", ""); + if (tag != version) + { + context.Error($"Version do not match. From File: {version}. From Ref: {tag}"); + Environment.Exit(-1); + } + } + } + + context.Information($"MaaCore Version: {version}"); + + context.Information("--------------------------------------------------"); + context.Information("2. Release MaaCore with third party dlls and resource"); + context.Information("--------------------------------------------------"); + + var buildOutput = Path.Combine(Constants.MaaBuildOutputDirectory, "Release"); + context.CleanAll(); + context.CleanArtifacts(); + + context.BuildCore("Release"); + context.RemoveExtraCore(buildOutput); + + context.Information("--------------------------------------------------"); + context.Information("3. Release MaaWpf with third party executables"); + context.Information("--------------------------------------------------"); + + context.BuildWpf("Release"); + context.RemoveExtraWpf(buildOutput); + + context.Information("--------------------------------------------------"); + context.Information("4. Bundle MaaBundle package"); + context.Information("--------------------------------------------------"); + + var bundle = Path.Combine(Constants.MaaProjectArtifactDirectory, $"MaaBundle-{version}.zip"); + ZipFile.CreateFromDirectory(buildOutput, bundle); + + context.Information($"Bundled MaaBundle file: {bundle}"); + } +} From 96c03d3079976caabbdb410e828c9dc3e6bf1d1e Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Tue, 10 May 2022 00:15:13 +0800 Subject: [PATCH 22/24] =?UTF-8?q?ci.=E4=BF=AE=E5=A4=8D=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maa-dev-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maa-dev-build.yaml b/.github/workflows/maa-dev-build.yaml index f4e182094f..aa321e67d0 100644 --- a/.github/workflows/maa-dev-build.yaml +++ b/.github/workflows/maa-dev-build.yaml @@ -40,7 +40,7 @@ jobs: - name: Read file name id: read_path - run: pwsh .\read_path.ps1 ./artifacts MaaBundle + run: pwsh .\read_path.ps1 ./artifacts MaaBundle* - name: Upload Artifacts 0 uses: actions/upload-artifact@v3 From fc5bf758c3d4c39510b48091187b708b30b200ec Mon Sep 17 00:00:00 2001 From: Liam Sho Date: Tue, 10 May 2022 01:50:42 +0800 Subject: [PATCH 23/24] =?UTF-8?q?fix.=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91?= =?UTF-8?q?=20Warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAsstGui/App.config | 2 +- src/MeoAsstGui/Helper/ToastNotification.cs | 63 +++++++++++----------- src/MeoAsstGui/MeoAsstGui.csproj | 6 +-- 3 files changed, 33 insertions(+), 38 deletions(-) diff --git a/src/MeoAsstGui/App.config b/src/MeoAsstGui/App.config index 9681c0bbc8..d3b6d9590a 100644 --- a/src/MeoAsstGui/App.config +++ b/src/MeoAsstGui/App.config @@ -11,7 +11,7 @@ - + diff --git a/src/MeoAsstGui/Helper/ToastNotification.cs b/src/MeoAsstGui/Helper/ToastNotification.cs index 16edc963a4..86a4a8d80c 100644 --- a/src/MeoAsstGui/Helper/ToastNotification.cs +++ b/src/MeoAsstGui/Helper/ToastNotification.cs @@ -139,46 +139,45 @@ namespace MeoAsstGui /// 提示音类型 protected async Task PlayNotificationSoundAsync(NotificationSounds sounds = NotificationSounds.None) { - await Task.Run(() => + try { - - try + switch (sounds) { - switch (sounds) - { - case NotificationSounds.Exclamation: SystemSounds.Exclamation.Play(); break; - case NotificationSounds.Asterisk: SystemSounds.Asterisk.Play(); break; - case NotificationSounds.Question: SystemSounds.Question.Play(); break; - case NotificationSounds.Beep: SystemSounds.Beep.Play(); break; - case NotificationSounds.Hand: SystemSounds.Hand.Play(); break; + case NotificationSounds.Exclamation: SystemSounds.Exclamation.Play(); break; + case NotificationSounds.Asterisk: SystemSounds.Asterisk.Play(); break; + case NotificationSounds.Question: SystemSounds.Question.Play(); break; + case NotificationSounds.Beep: SystemSounds.Beep.Play(); break; + case NotificationSounds.Hand: SystemSounds.Hand.Play(); break; - case NotificationSounds.Notification: - using (var key = Registry.CurrentUser.OpenSubKey(@"AppEvents\Schemes\Apps\.Default\Notification.Default\.Current")) + case NotificationSounds.Notification: + using (var key = Registry.CurrentUser.OpenSubKey(@"AppEvents\Schemes\Apps\.Default\Notification.Default\.Current")) + { + if (key != null) { - if (key != null) + // 获取 (Default) 项 + var o = key.GetValue(null); + if (o != null) { - // 获取 (Default) 项 - var o = key.GetValue(null); - if (o != null) - { - var theSound = new SoundPlayer((string)o); - theSound.Play(); - } - } - else - { - // 如果不支持就播放其它提示音 - PlayNotificationSoundAsync(NotificationSounds.Asterisk); + var theSound = new SoundPlayer((string)o); + theSound.Play(); } } - break; + else + { + // 如果不支持就播放其它提示音 + await PlayNotificationSoundAsync(NotificationSounds.Asterisk); + } + } + break; - case NotificationSounds.None: - default: break; - } + case NotificationSounds.None: + default: break; } - catch (Exception) { } - }).ConfigureAwait(false); + } + catch (Exception) + { + // Ignore + } } #endregion @@ -316,7 +315,7 @@ namespace MeoAsstGui } // 播放通知提示音 - PlayNotificationSoundAsync(sound); + PlayNotificationSoundAsync(sound).Wait(); // 任务栏闪烁 FlashWindowEx(); diff --git a/src/MeoAsstGui/MeoAsstGui.csproj b/src/MeoAsstGui/MeoAsstGui.csproj index 9d8e758887..085d1814c6 100644 --- a/src/MeoAsstGui/MeoAsstGui.csproj +++ b/src/MeoAsstGui/MeoAsstGui.csproj @@ -76,9 +76,6 @@ true - - ..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - @@ -242,8 +239,7 @@ 5.7.0 - runtime; build; native; contentfiles; analyzers; buildtransitive - all + All 3.1.1 From b7fe5edbe0f0471032132b9cd399c3d2faa0bc9e Mon Sep 17 00:00:00 2001 From: MistEO Date: Tue, 10 May 2022 17:46:29 +0800 Subject: [PATCH 24/24] =?UTF-8?q?docs.=E6=9B=B4=E6=96=B0=E5=85=B3=E4=BA=8E?= =?UTF-8?q?WSA=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/模拟器支持.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/模拟器支持.md b/docs/模拟器支持.md index 506a0f41c7..8c9efc2a16 100644 --- a/docs/模拟器支持.md +++ b/docs/模拟器支持.md @@ -53,7 +53,7 @@ ### Win11 WSA -不支持。WSA 目前没有实现 AOSP screencap 需要的接口,无法进行截图。等微软支持后会尝试适配 +勉强支持。但 WSA 的截图经常莫名其妙截出来一个白屏,导致识别异常,不推荐使用 ### AVD