ci: temporarily revert changes to ResourceUpdater to allow caching exe

This commit is contained in:
Constrat
2025-09-11 13:09:07 +02:00
parent 53d058de06
commit d4f5ad3829
2 changed files with 19 additions and 31 deletions

View File

@@ -146,8 +146,8 @@ jobs:
with:
key: Resource-updater-${{ hashFiles('./tools/ResourceUpdater/main.cpp') }}
path: |
./tools/ResourceUpdater/opencv_world4_maa.dll
./tools/ResourceUpdater/ResourceUpdater.exe
./tools/ResourceUpdater/x64/Release/opencv_world4_maa.dll
./tools/ResourceUpdater/x64/Release/ResourceUpdater.exe
- name: Cache MaaDeps
if: steps.cache-resupd.outputs.cache-hit != 'true'
@@ -165,18 +165,14 @@ jobs:
run: |
python3 tools/maadeps-download.py x64-windows
- name: Config cmake
run: |
mkdir -p build
cmake -B build -DCMAKE_BUILD_TYPE=Release -DMAADEPS_TRIPLET='maa-x64-windows' -DMAA_HASH_VERSION='${{ needs.meta.outputs.tag }}' -DBUILD_WPF_GUI=OFF -DBUILD_RES_UPDATER=ON
- name: Add msbuild to PATH
if: steps.cache-resupd.outputs.cache-hit != 'true'
uses: microsoft/setup-msbuild@v2
- name: Build Resource Updater
if: steps.cache-resupd.outputs.cache-hit != 'true'
run: |
cmake --build build --target ResourceUpdater --config Release --parallel $env:NUMBER_OF_PROCESSORS
- name: Install Resource Updater
run: |
cmake --install build --component ResourceUpdater --config Release --prefix tools/ResourceUpdater
MSBUILD tools/ResourceUpdater/ResourceUpdater.vcxproj /t:rebuild /p:Configuration="Release" /p:Platform="x64" /p:BuildProjectReferences=false /m
- name: Save ResourceUpdater.exe to cache
if: always() && steps.cache-resupd.outputs.cache-hit != 'true'
@@ -184,8 +180,8 @@ jobs:
with:
key: Resource-updater-${{ hashFiles('./tools/ResourceUpdater/main.cpp') }}
path: |
./tools/ResourceUpdater/opencv_world4_maa.dll
./tools/ResourceUpdater/ResourceUpdater.exe
./tools/ResourceUpdater/x64/Release/opencv_world4_maa.dll
./tools/ResourceUpdater/x64/Release/ResourceUpdater.exe
- name: Download txwy
id: download-txwy
@@ -193,7 +189,7 @@ jobs:
continue-on-error: true
with:
name: txwy
path: ./tools/ResourceUpdater/Overseas/tw/gamedata/excel
path: ./tools/ResourceUpdater/x64/Release/Overseas/tw/gamedata/excel
- name: Delay txwy
if: steps.download-txwy.outcome == 'failure'
@@ -205,7 +201,7 @@ jobs:
uses: actions/download-artifact@v5
with:
name: txwy
path: ./tools/ResourceUpdater/Overseas/tw/gamedata/excel
path: ./tools/ResourceUpdater/x64/Release/Overseas/tw/gamedata/excel
- name: Download Overseas
id: download-overseas
@@ -213,7 +209,7 @@ jobs:
continue-on-error: true
with:
name: overseas
path: ./tools/ResourceUpdater/Overseas
path: ./tools/ResourceUpdater/x64/Release/Overseas
- name: Delay Overseas
if: steps.download-overseas.outcome == 'failure'
@@ -225,7 +221,7 @@ jobs:
uses: actions/download-artifact@v5
with:
name: overseas
path: ./tools/ResourceUpdater/Overseas
path: ./tools/ResourceUpdater/x64/Release/Overseas
- name: Download Official
id: download-official
@@ -233,7 +229,7 @@ jobs:
continue-on-error: true
with:
name: official
path: ./tools/ResourceUpdater/Official
path: ./tools/ResourceUpdater/x64/Release/Official
- name: Delay Official
if: steps.download-official.outcome == 'failure'
@@ -245,11 +241,11 @@ jobs:
uses: actions/download-artifact@v5
with:
name: official
path: ./tools/ResourceUpdater/Official
path: ./tools/ResourceUpdater/x64/Release/Official
- name: Run Resource Updater
run: |
./tools/ResourceUpdater/ResourceUpdater.exe
./tools/ResourceUpdater/x64/Release/ResourceUpdater.exe
- name: Task Sorting
id: task_sorting

View File

@@ -1,7 +1,6 @@
#include <chrono>
#include <filesystem>
#include <fstream>
#include <thread>
#include <unordered_set>
#include <meojson/json.hpp>
@@ -69,9 +68,7 @@ bool update_version_info(const fs::path& input_dir, const fs::path& output_dir);
int main([[maybe_unused]] int argc, char** argv)
{
#if defined(_WIN32)
SetConsoleOutputCP(CP_UTF8);
#endif
// ---- PATH DECLARATION ----
@@ -621,12 +618,7 @@ bool update_infrast_data(const fs::path& input_dir, const fs::path& output_dir)
{ "MEETING", "Reception" }, { "HIRE", "Office" }, { "TRAINING", "" },
};
// TODO: new meojson seems not support basic_object | std::views::values
for (auto& [key, val] : buffs) {
std::ignore = key;
auto& buff_obj = val;
// }
// for (auto& buff_obj : buffs | std::views::values) {
for (auto& buff_obj : buffs | asst::views::values) {
std::string room_type;
if (buff_obj["roomType"].is_number()) {
@@ -1048,9 +1040,9 @@ bool update_battle_chars_info(const fs::path& official_dir, const fs::path& over
bool update_recruitment_data(const fs::path& input_dir, const fs::path& output, bool is_base)
{
using std::ranges::find_if, std::ranges::range;
using asst::ranges::find_if, asst::ranges::range;
using asst::utils::string_replace_all_in_place;
using std::views::filter, std::views::split, std::views::transform, std::views::drop_while;
using asst::views::filter, asst::views::split, asst::views::transform, asst::views::drop_while;
auto not_empty = []<range Rng>(Rng str) -> bool {
return !str.empty();