From 3c4faef29f14b0e21c53a3ea2f2aad036761f4c4 Mon Sep 17 00:00:00 2001 From: Horror Proton <107091537+horror-proton@users.noreply.github.com> Date: Thu, 27 Apr 2023 23:07:35 +0800 Subject: [PATCH 01/16] perf: imporve ota building speed --- .github/workflows/release-nightly-ota.yml | 3 +- .github/workflows/release-ota.yml | 4 +-- .../ViewModels/UI/VersionUpdateViewModel.cs | 2 +- src/Python/asst/updater.py | 6 ++-- tools/OTAPacker/build.sh | 27 +++++++---------- tools/OTAPacker/ziplist.sh | 5 ++++ tools/OTAPacker/zipota.sh | 29 +++++++++++++++++++ 7 files changed, 51 insertions(+), 25 deletions(-) create mode 100755 tools/OTAPacker/ziplist.sh create mode 100755 tools/OTAPacker/zipota.sh diff --git a/.github/workflows/release-nightly-ota.yml b/.github/workflows/release-nightly-ota.yml index 9509f624a7..89e3d2fc2c 100644 --- a/.github/workflows/release-nightly-ota.yml +++ b/.github/workflows/release-nightly-ota.yml @@ -144,8 +144,7 @@ jobs: run: | mkdir -pv build-ota && cd build-ota cd ${{ needs.build-win-nightly.outputs.tag }} - mkdir -pv content - unzip -q -O GB2312 -o *.zip -x '*.lib' -x '*.pdb' -x '*.exp' -x '*.config' -x '*.xml' -d content + zip -d *.zip '*.lib' '*.pdb' '*.exp' '*.config' '*.xml' cd .. gh release list --repo 'MaaAssistantArknights/MaaAssistantArknights' --limit ${{ inputs.limit || 30 }} | tee ./release_maa.txt diff --git a/.github/workflows/release-ota.yml b/.github/workflows/release-ota.yml index a77eb0def8..83bdb19e3d 100644 --- a/.github/workflows/release-ota.yml +++ b/.github/workflows/release-ota.yml @@ -54,10 +54,8 @@ jobs: run: | mkdir -pv build-ota/${{ env.release_tag }} cd build-ota/${{ env.release_tag }} - mkdir -pv content gh release download ${{ env.release_tag }} --repo 'MaaAssistantArknights/MaaAssistantArknights' --pattern "MAA-${{ env.release_tag }}-win-${{ matrix.target }}.zip" --clobber - unzip -q -O GB2312 -o "*.zip" -d 'content' - mv *.zip .. + cp *.zip .. env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: "Build OTA" diff --git a/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs b/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs index 6f7dd9e0ba..9b3559b17d 100644 --- a/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs @@ -252,7 +252,7 @@ namespace MaaWpfGui.ViewModels.UI foreach (var file in Directory.GetFiles(extractDir, "*", SearchOption.AllDirectories)) { var fileName = Path.GetFileName(file); - if (fileName == "removelist.txt" || fileName == "md5sum.txt") + if (fileName == "removelist.txt" || fileName == "filelist.txt") { continue; } diff --git a/src/Python/asst/updater.py b/src/Python/asst/updater.py index 1f917daa2a..c1e7b8f113 100644 --- a/src/Python/asst/updater.py +++ b/src/Python/asst/updater.py @@ -201,9 +201,9 @@ class Updater: f.close() remove_with_print(removelist_path) - md5sum_path = os.path.join(self.path, 'md5sum.txt') - if os.path.isfile(md5sum_path): - remove_with_print(md5sum_path) + filelist_path = os.path.join(self.path, 'filelist.txt') + if os.path.isfile(filelist_path): + remove_with_print(filelist_path) for file in os.listdir(self.path): if 'OTA' in file: file_path = os.path.join(self.path, file) diff --git a/tools/OTAPacker/build.sh b/tools/OTAPacker/build.sh index a85ccdc42a..6e6a6b9c48 100755 --- a/tools/OTAPacker/build.sh +++ b/tools/OTAPacker/build.sh @@ -15,32 +15,27 @@ latest_tag=$(head -n 1 "$releases_txt") while read tag; do echo "::group::$tag" - if [ ! -d "$tag"/content ]; then + if [ ! -f "$tag"/MAA-$tag-win-$arch.zip ]; then mkdir -pv "$tag" - cd "$tag" echo "Downloading $tag" gh release download "$tag" --repo $source_repo --pattern "MAA-$tag-win-$arch.zip" --clobber \ || gh release download "$tag" --repo $source_repo_fallback --pattern "MAA-$tag-win-$arch.zip" --clobber \ || { echo "::warning:: win $arch not found in release $tag skipping."; echo "::endgroup::"; continue; } - mkdir -pv 'content' - unzip -q -O GB2312 -o "*.zip" -d 'content' - rm -fv *.zip - cd $working_dir + mv MAA-$tag-win-$arch.zip $tag else - echo "$tag"/content/ already exists + echo "$tag"/MAA-$tag-win-$arch.zip already exists fi if [[ "$tag" == "$latest_tag" ]]; then - cd "$latest_tag"/content/ - find * -type f -exec md5sum '{}' \; > md5sum.txt - cd $working_dir + find "$latest_tag" else - echo "Comparing and installing files $tag...$latest_tag" - mkdir -pv "$tag"/pkg - "$script_dir"/makeota.sh "$tag"/content "$latest_tag"/content "$tag"/pkg - echo "Creating zip archive" - cd "$tag"/pkg - zip -q -9 -r "$working_dir"/"MAAComponent-OTA-${tag}_${latest_tag}-win-$arch.zip" . + "$script_dir"/zipota.sh \ + $tag/MAA-$tag-win-$arch.zip \ + $latest_tag/MAA-$latest_tag-win-$arch.zip \ + "$working_dir"/"MAAComponent-OTA-${tag}_${latest_tag}-win-$arch.zip" + + rm -fv $tag/MAA-$tag-win-$arch.zip + cd $working_dir fi diff --git a/tools/OTAPacker/ziplist.sh b/tools/OTAPacker/ziplist.sh new file mode 100755 index 0000000000..9dff735373 --- /dev/null +++ b/tools/OTAPacker/ziplist.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +zipinfo -O GB2312 -v $1 \ + | sed -n -e '/^Central directory entry/,+3p' -e '/32-bit CRC value (hex):/p' | grep '^ ' \ + | sed -e 's/^ //g' | sed -z 's/\n32-bit CRC value (hex):\s*/\t/g' \ + | awk '{last = $NF; $NF=""; print last,$0}' diff --git a/tools/OTAPacker/zipota.sh b/tools/OTAPacker/zipota.sh new file mode 100755 index 0000000000..d2281fcdf2 --- /dev/null +++ b/tools/OTAPacker/zipota.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +script_dir="$(dirname $(realpath "$0"))" + +from_zip="$1" +to_zip="$2" +out_zip="$3" + +from_list="$("$script_dir"/ziplist.sh "$from_zip" | sort)" +to_list="$("$script_dir"/ziplist.sh "$to_zip" | sort)" + +# files with same name and content +comm_list="$(comm -12 <(echo "$from_list") <(echo "$to_list"))" + +from_fn="$(echo "$from_list" | cut -d\ -f2- | sort)" +to_fn="$(echo "$to_list" | cut -d\ -f2- | sort)" + +cp -v "$to_zip" "$out_zip" + +echo "$comm_list" | cut -d\ -f2- | xargs zip --delete "$out_zip" + +tmpdir=$(mktemp -d /tmp/zipota-files.XXX) + +comm -23 <(echo "$from_fn") <(echo "$to_fn") > "$tmpdir"/removelist.txt +echo "$to_fn" > "$tmpdir"/filelist.txt + +zip -r -j "$out_zip" "$tmpdir"/removelist.txt "$tmpdir"/filelist.txt + +rm -rf $tmpdir From 1d9ba4049b00be88102de9d0b01488080fa96790 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 17:10:07 +0800 Subject: [PATCH 02/16] chore: do not run issue checker when pushing --- .github/workflows/issue-checker.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/issue-checker.yml b/.github/workflows/issue-checker.yml index e590525b7a..d16723314f 100644 --- a/.github/workflows/issue-checker.yml +++ b/.github/workflows/issue-checker.yml @@ -6,7 +6,6 @@ on: types: [opened, edited] issue_comment: types: [created, edited] - push: permissions: contents: read From 57fda97a9506f6bbb2c6dacbe13c51bb963379c1 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 17:17:26 +0800 Subject: [PATCH 03/16] =?UTF-8?q?chore:=20=E5=8F=AA=E5=9C=A8=E6=BA=90?= =?UTF-8?q?=E7=A0=81=E7=9B=B8=E5=85=B3=E6=96=87=E4=BB=B6=E8=A2=AB=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=97=B6=E6=89=8D=E8=A7=A6=E5=8F=91=20build=20CI=20(#?= =?UTF-8?q?4561)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update ci.yml --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6bb5d0d7f5..f87a8a94cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,9 +6,23 @@ on: - 'v*' branches-ignore: - 'master' + paths: + - '3rdparty/include/**' + - 'include/**' + - 'src/**' + - 'cmake/**' + - 'CMakeLists.txt' + - 'MAA.sln' pull_request: branches: - 'dev' + paths: + - '3rdparty/include/**' + - 'include/**' + - 'src/**' + - 'cmake/**' + - 'CMakeLists.txt' + - 'MAA.sln' workflow_dispatch: jobs: From b982cc5b6bbbab85b6d93f4d0f067c0275322642 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 17:25:28 +0800 Subject: [PATCH 04/16] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8A=BD?= =?UTF-8?q?=E5=8D=A1=E6=9C=89=E6=97=B6=E5=80=99=E8=BF=9B=E4=B8=8D=E5=8E=BB?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/tasks.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resource/tasks.json b/resource/tasks.json index b93c8768c9..e3fe0d4d4b 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -12056,6 +12056,7 @@ 156 ], "next": [ + "GachaEnter", "GachaEnter@LoadingText", "DoGacha" ] From 110886fc6dc5410a6741ca2b60e01381cfaa4bd3 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 17:36:00 +0800 Subject: [PATCH 05/16] =?UTF-8?q?revert:=20sample=20=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Cpp/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cpp/main.cpp b/src/Cpp/main.cpp index 04ee59ba71..c3cc5ae573 100644 --- a/src/Cpp/main.cpp +++ b/src/Cpp/main.cpp @@ -33,7 +33,7 @@ int main([[maybe_unused]] int argc, char** argv) #ifndef ASST_DEBUG AsstAsyncConnect(ptr, "adb", "127.0.0.1:5555", nullptr, true); #else - AsstAsyncConnect(ptr, "adb", "127.0.0.1:3439", "General", true); + AsstAsyncConnect(ptr, "adb", "127.0.0.1:5555", "DEBUG", true); #endif if (!AsstConnected(ptr)) { std::cerr << "connect failed" << std::endl; @@ -94,7 +94,7 @@ int main([[maybe_unused]] int argc, char** argv) #else - AsstAppendTask(ptr, "Custom", R"({"task_names": [ "GachaOnce" ] })"); + AsstAppendTask(ptr, "Debug", nullptr); #endif From fb017bf7dce7f35a2539c0a0692f7592a0d67ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?DL=5F=E5=90=9B=E9=80=B8=E5=AF=92?= <84064064+junyihan233@users.noreply.github.com> Date: Sun, 30 Apr 2023 18:00:10 +0800 Subject: [PATCH 06/16] =?UTF-8?q?Update=20SSS=5F=E9=9B=B7=E7=A5=9E?= =?UTF-8?q?=E5=B7=A5=E4=B8=9A=E6=B5=8B=E8=AF=95=E5=B9=B3=E5=8F=B0=5F?= =?UTF-8?q?=E6=B5=8A=E8=92=82=E7=89=88.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 黑名单中新增缪尔赛思! --- resource/copilot/SSS_雷神工业测试平台_浊蒂版.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resource/copilot/SSS_雷神工业测试平台_浊蒂版.json b/resource/copilot/SSS_雷神工业测试平台_浊蒂版.json index bc6796a768..440b1e3815 100644 --- a/resource/copilot/SSS_雷神工业测试平台_浊蒂版.json +++ b/resource/copilot/SSS_雷神工业测试平台_浊蒂版.json @@ -78,6 +78,7 @@ "豆苗", "夜半", "伺夜", + "缪尔赛思", "桃金娘", "极境", "琴柳", From 1d26578b6d3acd8d44c6197f4c03a317d9e527c8 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 19:32:16 +0800 Subject: [PATCH 07/16] =?UTF-8?q?chore:=20CI=20=E5=86=92=E7=83=9F=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20(#4565)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Delete dev-build-linux.yml * Delete dev-build-mac.yml * Delete dev-build-win.yml * Create smoke-testing.yml * Update smoke-testing.yml * Update smoke-testing.yml * Update smoke-testing.yml * Update smoke-testing.yml * Update smoke-testing.yml * Update smoke-testing.yml * Update smoke-testing.yml * Update smoke-testing.yml * Update smoke-testing.yml * Update smoke-testing.yml * Create MaaSample.slnf * Update smoke-testing.yml * Update MaaSample.slnf * Update MaaSample.slnf * Update MaaSample.slnf * Update MaaSample.slnf * Update smoke-testing.yml --- .github/workflows/dev-build-linux.yml | 68 -------------------- .github/workflows/dev-build-mac.yml | 60 ------------------ .github/workflows/dev-build-win.yml | 91 --------------------------- .github/workflows/smoke-testing.yml | 55 ++++++++++++++++ src/Cpp/MaaSample.slnf | 10 +++ 5 files changed, 65 insertions(+), 219 deletions(-) delete mode 100644 .github/workflows/dev-build-linux.yml delete mode 100644 .github/workflows/dev-build-mac.yml delete mode 100644 .github/workflows/dev-build-win.yml create mode 100644 .github/workflows/smoke-testing.yml create mode 100644 src/Cpp/MaaSample.slnf diff --git a/.github/workflows/dev-build-linux.yml b/.github/workflows/dev-build-linux.yml deleted file mode 100644 index 4705a06878..0000000000 --- a/.github/workflows/dev-build-linux.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: dev-build-linux - -on: - push: - branches-ignore: - - master - paths: - - 'src/MaaCore/**' - - '3rdparty/**' - - 'include/**' - - 'resource/**' - - 'cmake/**' - - CMakeLists.txt - pull_request: - branches: - - dev - paths: - - 'src/MaaCore/**' - - '3rdparty/**' - - 'include/**' - - 'resource/**' - - 'cmake/**' - - CMakeLists.txt - -jobs: - linux-latest: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Setup ccache - uses: Chocobo1/setup-ccache-action@v1 - with: - remove_stale_cache: false - - name: Bootstrap MaaDeps - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - python3 maadeps-download.py - - name: Build MAA - env: - CC: ccache gcc-12 - CXX: ccache g++-12 - run: | - mkdir -p build - cmake -B build \ - -DINSTALL_THIRD_LIBS=ON \ - -DINSTALL_RESOURCE=OFF \ - -DINSTALL_PYTHON=OFF - # -DFASTDEPLOY_DIRECTORY=~/fastdeploy \ - # -DOPENCV_DIRECTORY=~/opencv/lib/cmake/opencv4 \ - cmake --build build --parallel $(nproc --all) - - mkdir -p install - cmake --install build --prefix install - - - name: tar files - run: | - mkdir -p release - cd install - tar czvf $GITHUB_WORKSPACE/release/MaaAssistantArknights.tar.gz . - - - uses: actions/upload-artifact@v3 - with: - name: MAA-linux - path: release/*.tar.gz diff --git a/.github/workflows/dev-build-mac.yml b/.github/workflows/dev-build-mac.yml deleted file mode 100644 index eb74098dd0..0000000000 --- a/.github/workflows/dev-build-mac.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: dev-build-mac - -on: - push: - branches-ignore: - - master - paths: - - 'src/MaaCore/**' - - 'src/MaaMacGui/**' - - '3rdparty/**' - - 'include/**' - - 'resource/**' - - 'cmake/**' - - CMakeLists.txt - pull_request: - branches: - - dev - paths: - - 'src/MaaCore/**' - - 'src/MaaMacGui/**' - - '3rdparty/**' - - 'include/**' - - 'resource/**' - - 'cmake/**' - - CMakeLists.txt - -jobs: - macos-latest: - runs-on: macos-12 - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 100 - - name: Cache Homebrew - uses: actions/cache@v3 - with: - path: $(brew --prefix) - key: ${{ runner.os }}-homebrew-${{ hashFiles('.config/brew/Brewfile') }} - - name: Install Dependencies - run: | - brew update --preinstall - brew install ninja pkg-config range-v3 - - name: Bootstrap MaaDeps - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - python3 maadeps-download.py - - name: Configure MaaCore - run: | - cmake -B build -GNinja -DBUILD_XCFRAMEWORK=ON -DCMAKE_OSX_ARCHITECTURES=x86_64 - - name: Build libMaaCore - run: cmake --build build - - name: Build MAA - working-directory: src/MaaMacGui - run: xcodebuild CODE_SIGN_IDENTITY="-" DEVELOPMENT_TEAM="-" -derivedDataPath DerivedData -project MeoAsstMac.xcodeproj -scheme MAA - - uses: actions/upload-artifact@v3 - with: - name: MAA-macos - path: src/MaaMacGui/DerivedData/Build/Products/Debug diff --git a/.github/workflows/dev-build-win.yml b/.github/workflows/dev-build-win.yml deleted file mode 100644 index 4eeac829e1..0000000000 --- a/.github/workflows/dev-build-win.yml +++ /dev/null @@ -1,91 +0,0 @@ -# ------------------------------------------------------------------------------ -# -# -# This code was generated. -# -# - To turn off auto-generation set: -# -# [GitHubActions (AutoGenerate = false)] -# -# - To trigger manual generation invoke: -# -# nuke --generate-configuration GitHubActions_dev-build-win --host GitHubActions -# -# -# ------------------------------------------------------------------------------ - -name: dev-build-win - -on: - push: - branches-ignore: - - master - paths: - - 'src/MaaCore/**' - - 'src/MaaWpfGui/**' - - '3rdparty/**' - - 'tools/MaaBuilder/**' - - tools/MaaBuilder.sln - - 'include/**' - - 'resource/**' - - MAA.sln - pull_request: - branches: - - dev - paths: - - 'src/MaaCore/**' - - 'src/MaaWpfGui/**' - - '3rdparty/**' - - 'tools/MaaBuilder/**' - - tools/MaaBuilder.sln - - 'include/**' - - 'resource/**' - - MAA.sln - workflow_dispatch: - inputs: - Reason: - description: "Reason" - required: true - ReleaseSimulation: - description: "Release Simulation" - required: true - -jobs: - windows-latest: - strategy: - matrix: - include: - - msbuild_target: x64 - lowercase_target: x64 - - msbuild_target: ARM64 - lowercase_target: arm64 - fail-fast: false - env: - MAABUILDER_TARGET_PLATFORM: ${{ matrix.msbuild_target }} - name: windows-latest - runs-on: windows-latest - steps: - - uses: actions/checkout@v3 - - name: Cache .nuke/temp, ~/.nuget/packages - uses: actions/cache@v3 - with: - path: | - .nuke/temp - ~/.nuget/packages - key: ${{ runner.os }}-${{ matrix.msbuild_target }}-${{ hashFiles('**/global.json', '**/*.csproj') }} - - name: Bootstrap MaaDeps - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - python3 maadeps-download.py ${{ matrix.lowercase_target }}-windows - - name: Run './build.cmd DevBuild' - run: | - ./build.cmd DevBuild - env: - Reason: ${{ github.event.inputs.Reason }} - ReleaseSimulation: ${{ github.event.inputs.ReleaseSimulation }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/upload-artifact@v3 - with: - name: MAA-win-${{ matrix.lowercase_target }} - path: artifacts diff --git a/.github/workflows/smoke-testing.yml b/.github/workflows/smoke-testing.yml new file mode 100644 index 0000000000..894d543a4e --- /dev/null +++ b/.github/workflows/smoke-testing.yml @@ -0,0 +1,55 @@ +name: test + +on: + push: + paths: + - '3rdparty/include/**' + - 'include/**' + - 'src/**' + - 'cmake/**' + - 'CMakeLists.txt' + - 'MAA.sln' + - 'resource/**' + - 'MaaDeps/**' + pull_request: + paths: + - '3rdparty/include/**' + - 'include/**' + - 'src/**' + - 'cmake/**' + - 'CMakeLists.txt' + - 'MAA.sln' + - 'resource/**' + - 'MaaDeps/**' + workflow_dispatch: + +jobs: + smoke-testing: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + + - uses: NuGet/setup-nuget@v1.2.0 + - run: nuget restore MAA.sln + + - name: Bootstrap MaaDeps + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + python3 maadeps-download.py x64-windows + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1 + - name: Build MaaSample + run: | + MSBUILD src/Cpp/MaaSample.slnf /t:rebuild /p:Configuration="Debug" /p:Platform="x64" /m + + - name: Run Testing + run: | + .\x64\Debug\Sample.exe + + - name: Upload Logs + uses: actions/upload-artifact@v3 + with: + name: log + path: .\x64\Debug\debug diff --git a/src/Cpp/MaaSample.slnf b/src/Cpp/MaaSample.slnf new file mode 100644 index 0000000000..75414af9fe --- /dev/null +++ b/src/Cpp/MaaSample.slnf @@ -0,0 +1,10 @@ +{ + "solution": { + "path": "..\\..\\MAA.sln", + "projects": [ + "src\\MaaCore\\MaaCore.vcxproj", + "src\\Cpp\\MaaSample.vcxproj", + "src\\SyncRes\\SyncRes.csproj", + ] + } +} From e7e35f80d27caf3c0e31ba4508d55b261de668c3 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 19:46:47 +0800 Subject: [PATCH 08/16] =?UTF-8?q?chore:=20=E6=94=B9=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Assistant.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MaaCore/Assistant.cpp b/src/MaaCore/Assistant.cpp index 7df8c1a6a5..1054327c8c 100644 --- a/src/MaaCore/Assistant.cpp +++ b/src/MaaCore/Assistant.cpp @@ -322,7 +322,7 @@ std::vector asst::Assistant::get_tasks_list() const bool asst::Assistant::start(bool block) { LogTraceFunction; - Log.trace("Start |", block ? "block" : "non block"); + Log.info("Start |", block ? "block" : "non block"); if (!m_thread_idle) { return false; @@ -341,7 +341,7 @@ bool asst::Assistant::start(bool block) bool Assistant::stop(bool block) { LogTraceFunction; - Log.trace("Stop |", block ? "block" : "non block"); + Log.info("Stop |", block ? "block" : "non block"); m_thread_idle = true; From da857ef4c440203f4da0cd447a54b71387fd7f35 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 20:31:57 +0800 Subject: [PATCH 09/16] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3box=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E6=BD=9C=E8=83=BD=E5=AD=97=E6=AE=B5=EF=BC=8C[1,6]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/3.2-回调消息协议.md | 6 +++--- docs/en-us/3.2-CALLBACK_SCHEMA.md | 8 +++++--- docs/ja-jp/3.2-コールバックAPI.md | 6 ++++-- docs/zh-tw/3.2-回呼訊息協定.md | 6 ++++-- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/3.2-回调消息协议.md b/docs/3.2-回调消息协议.md index 9f8ebf9b11..b3180e2c82 100644 --- a/docs/3.2-回调消息协议.md +++ b/docs/3.2-回调消息协议.md @@ -582,8 +582,8 @@ Todo "own": true, // 是否拥有 "elite": 2, // 精英度 0,1,2 "level": 50, // 干员等级 - "potential": 5, // 干员潜能 0-5 - "rarity": 5 // 干员稀有度 1-6 + "potential": 6, // 干员潜能 [1, 6] + "rarity": 5 // 干员稀有度 [1, 6] }, { "id": "char_003_kalts", @@ -591,7 +591,7 @@ Todo "own": true, "elite": 2, "level": 50, - "potential": 0, + "potential": 1, "rarity": 6 } ] diff --git a/docs/en-us/3.2-CALLBACK_SCHEMA.md b/docs/en-us/3.2-CALLBACK_SCHEMA.md index 262c057032..82e0f8a861 100644 --- a/docs/en-us/3.2-CALLBACK_SCHEMA.md +++ b/docs/en-us/3.2-CALLBACK_SCHEMA.md @@ -574,7 +574,8 @@ Todo "own": true, // Whether owned "elite": 2, // Elite level 0, 1, 2 "level": 50, // Operator level - "potential": 5 // Operator potential 0-5 + "potential": 6, // Operator potential [1, 6] + "rarity": 5 // [1, 6] }, { "id": "char_003_kalts", @@ -582,10 +583,11 @@ Todo "own": true, "elite": 2, "level": 50, - "potential": 0 + "potential": 1, + "rarity": 6 } ] ``` - + - `UnsupportedLevel`
Unsupported level name diff --git a/docs/ja-jp/3.2-コールバックAPI.md b/docs/ja-jp/3.2-コールバックAPI.md index 42a7ee13d7..cc3e068bb4 100644 --- a/docs/ja-jp/3.2-コールバックAPI.md +++ b/docs/ja-jp/3.2-コールバックAPI.md @@ -543,7 +543,8 @@ Todo "own": true, // 持っているのでしょうか? "elite": 2, // エリート主義 0, 1, 2 "level": 50, // グレード - "potential": 5 // ポテンシャル 0-5 + "potential": 6, // ポテンシャル [1, 6] + "rarity": 5 // [1, 6] }, { "id": "char_003_kalts", @@ -551,7 +552,8 @@ Todo "own": true, "elite": 2, "level": 50, - "potential": 0 + "potential": 1, + "rarity": 6 } ] ``` diff --git a/docs/zh-tw/3.2-回呼訊息協定.md b/docs/zh-tw/3.2-回呼訊息協定.md index feab29d4b3..5dc7ec4177 100644 --- a/docs/zh-tw/3.2-回呼訊息協定.md +++ b/docs/zh-tw/3.2-回呼訊息協定.md @@ -543,7 +543,8 @@ Todo "own": true, // 是否擁有 "elite": 2, // 精英度 0, 1, 2 "level": 50, // 幹員等級 - "potential": 5 // 幹員潛能 0-5 + "potential": 6, // 幹員潛能 [1, 6] + "rarity": 5 // [1, 6] }, { "id": "char_003_kalts", @@ -551,7 +552,8 @@ Todo "own": true, "elite": 2, "level": 50, - "potential": 0 + "potential": 1, + "rarity": 6 } ] ``` From 30264b827055fcbe1602a7b869ee8bf499dc31e0 Mon Sep 17 00:00:00 2001 From: Hao Guan <10684225+hguandl@users.noreply.github.com> Date: Sun, 30 Apr 2023 23:47:39 +1000 Subject: [PATCH 10/16] =?UTF-8?q?feat:=20Mac=20UI=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=85=A8=E9=80=89/=E5=8F=96=E6=B6=88=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9A=84=E8=8F=9C=E5=8D=95=E5=92=8C=E5=BF=AB=E6=8D=B7=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaMacGui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MaaMacGui b/src/MaaMacGui index 70261711aa..813ffdd881 160000 --- a/src/MaaMacGui +++ b/src/MaaMacGui @@ -1 +1 @@ -Subproject commit 70261711aa52bd34917dd718be27e87519d7fa40 +Subproject commit 813ffdd881c324cdfdfb51ddcd438138c7cd1786 From c119d26a2c79736f82cd556aadce988d7b8abd0c Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 22:54:22 +0800 Subject: [PATCH 11/16] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0CI=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gen-changelog.yml | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/gen-changelog.yml diff --git a/.github/workflows/gen-changelog.yml b/.github/workflows/gen-changelog.yml new file mode 100644 index 0000000000..10e1b98262 --- /dev/null +++ b/.github/workflows/gen-changelog.yml @@ -0,0 +1,43 @@ +name: gen-changelog + +on: + workflow_dispatch: + inputs: + commit_message: + description: 'Commit Message' + type: string + required: false + +jobs: + gen: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Bootstrap MaaDeps + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + python3 tools/changelog_generator.py + + - name: Add files to git + run: | + git status + + git config user.name "$env:GITHUB_ACTOR" + git config user.email "$env:GITHUB_ACTOR@users.noreply.github.com" + git add . + + $commit_msg = "${{ github.event.inputs.commit_message }}" + if (-not [string]::IsNullOrWhiteSpace($commit_msg)) { + $commit_msg = $commit_msg.Trim() + } else { + $commit_msg = "docs: Auto Generate Changelog - $(Get-Date -Format 'yyyy-MM-dd')" + } + git commit -m "$commit_msg" + git pull origin $(git rev-parse --abbrev-ref HEAD) --unshallow --rebase + + - name: Push changes # push the output folder to your repo + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + force: false From 447c605ac35c85f3ebdcaaf76252d6c28d1bb25c Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 22:58:54 +0800 Subject: [PATCH 12/16] fix: gen-changelog.yml --- .github/workflows/gen-changelog.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gen-changelog.yml b/.github/workflows/gen-changelog.yml index 10e1b98262..cc376b710b 100644 --- a/.github/workflows/gen-changelog.yml +++ b/.github/workflows/gen-changelog.yml @@ -13,11 +13,11 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 - - name: Bootstrap MaaDeps + - name: Generate Changelog env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - python3 tools/changelog_generator.py + python3 tools/ChangelogGenerator/changelog_generator.py - name: Add files to git run: | From 6ae1108c8ebc1800a1002a8673def70d773a01e1 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 23:03:27 +0800 Subject: [PATCH 13/16] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E6=9B=B4?= =?UTF-8?q?=E6=96=B0changelog=E7=9A=84=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChangelogGenerator/changelog_generator.py | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/tools/ChangelogGenerator/changelog_generator.py b/tools/ChangelogGenerator/changelog_generator.py index 87716c0a15..9bd76cf269 100644 --- a/tools/ChangelogGenerator/changelog_generator.py +++ b/tools/ChangelogGenerator/changelog_generator.py @@ -2,7 +2,8 @@ from argparse import ArgumentParser import os import json import re -import requests +import urllib.request +import urllib.error cur_dir = os.path.dirname(__file__) contributors_path = os.path.abspath(os.path.join(cur_dir, 'contributors.json')) @@ -157,13 +158,42 @@ def print_commits(commits: dict, indent: str = "", need_sort: bool = True) -> (s return ret_message, ret_contributor + +def retry_urlopen(*args, **kwargs): + import time + import http.client + for _ in range(5): + try: + resp: http.client.HTTPResponse = urllib.request.urlopen(*args, **kwargs) + return resp + except urllib.error.HTTPError as e: + if e.status == 403 and e.headers.get("x-ratelimit-remaining") == "0": + # rate limit + t0 = time.time() + reset_time = t0 + 10 + try: + reset_time = int(e.headers.get("x-ratelimit-reset", 0)) + except ValueError: + pass + reset_time = max(reset_time, t0 + 10) + print(f"rate limit exceeded, retrying after {reset_time - t0:.1f} seconds") + time.sleep(reset_time - t0) + continue + raise + + # 贡献者名字转账号名 def convert_contributors_name(name: str, commit_hash: str, name_type: str): global contributors if name not in contributors: try: - github_info = requests.get(f"https://api.github.com/repos/MaaAssistantArknights/MaaAssistantArknights/commits/{commit_hash}") - userid = json.loads(github_info.text)[name_type]['login'] + req = urllib.request.Request(f"https://api.github.com/repos/MaaAssistantArknights/MaaAssistantArknights/commits/{commit_hash}") + token = os.environ.get("GH_TOKEN", os.environ.get("GITHUB_TOKEN", None)) + if token: + req.add_header("Authorization", f"Bearer {token}") + resp = retry_urlopen(req).read() + print(resp) + userid = json.loads(resp)[name_type]['login'] contributors.update({name: userid}) return userid except Exception as e: From 6d1051e8a55a3f45eab4d546201da404892ab956 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 23:05:45 +0800 Subject: [PATCH 14/16] fix: gen-changelog.yml --- .github/workflows/gen-changelog.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gen-changelog.yml b/.github/workflows/gen-changelog.yml index cc376b710b..3c23287d34 100644 --- a/.github/workflows/gen-changelog.yml +++ b/.github/workflows/gen-changelog.yml @@ -13,6 +13,9 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Generate Changelog env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -40,4 +43,5 @@ jobs: uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} - force: false + force_with_lease: true + branch: changelog From 0a16f6e02538c1c4f3d6b295ccc10f446697398e Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 23:07:53 +0800 Subject: [PATCH 15/16] fix: gen-changelog.yml --- .github/workflows/gen-changelog.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gen-changelog.yml b/.github/workflows/gen-changelog.yml index 3c23287d34..48429a5132 100644 --- a/.github/workflows/gen-changelog.yml +++ b/.github/workflows/gen-changelog.yml @@ -37,11 +37,11 @@ jobs: $commit_msg = "docs: Auto Generate Changelog - $(Get-Date -Format 'yyyy-MM-dd')" } git commit -m "$commit_msg" - git pull origin $(git rev-parse --abbrev-ref HEAD) --unshallow --rebase + git switch -c changelog - name: Push changes # push the output folder to your repo uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }} - force_with_lease: true + force: true branch: changelog From 469eb381f4aced1e7a45fc1fb39f15021fe279eb Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 30 Apr 2023 23:12:36 +0800 Subject: [PATCH 16/16] docs: changelog (#4570) Co-authored-by: MistEO --- CHANGELOG.md | 92 +++++----------------------------------------------- 1 file changed, 9 insertions(+), 83 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34cb2375f2..77afd06384 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,92 +1,18 @@ -## v4.16.0-beta.1 - -### 新增 - -- 牛牛抽卡! @MistEO @hguandl -- 新增肉鸽刷指路鳞(请在设置中打开) @MistEO @hguandl -- 新增内置保全作业 雷神工业测试平台 浊蒂版,更稳定 (#4528) @junyihan233 @MistEO -- Mac UI 支持启动 iOS 客户端 @hguandl -- Mac UI 仓库结果导出 JSON @hguandl -- 干员 BOX 识别增加等级和精英度 (#4438) @GD-GK @MistEO +## v4.16.0-rc.1 ### 改进 -- 优化资源加载速度 @MistEO @hguandl -- 大幅优化视频识别切片准确率 @MistEO -- 优化干员 BOX 识别准确率 @MistEO -- Vision 相关代码 超级大重构 @MistEO -- 优化保全雷神工业第五层部署逻辑 (#4503) @AnnoyingFlowers -- Win UI 添加模拟器检测错误日志输出、启动等待结束提示 @ABA2396 -- Win UI Add InstanceManager (#4422) (#4486) @moomiji -- Win UI 脚本运行不阻塞 UI (#4422) (#4486) @moomiji -- Win UI 优化主界面布局 @ABA2396 -- Win UI Do not save config on startup @MistEO -- Win UI 减慢弹出速率 @moomiji -- Mac UI 运行时防止系统进入睡眠 @hguandl -- Mac UI 启动前加载外服资源 @hguandl -- Mac UI 添加视频识别说明 @hguandl -- Auto Update Game Resources - 2023-04-27 @MistEO +- Mac UI 添加全选/取消任务的菜单和快捷键 @hguandl +- 更新保全作业 雷神工业测试平台_浊蒂版.json (#4563) @junyihan233 ### 修复 -- 修复 Win UI Changelog 弹窗 (#4422) (#4486) @moomiji -- 修复剿灭模式下任务失败时备选关卡为未在列表的主线关卡被跳过的问题 @ABA2396 -- 修复主线导航 ocrReplace 错误 @ABA2396 -- Mac UI 修复自定义基建文件权限 @hguandl -- 修复任务还未结束时就显示 Link Start @ABA2396 -- 部分肉鸽地图无法正确部署 (#4522) @LingXii -- 再次修复肉鸽“瞻前顾后”关卡名识别错误 @MistEO -- 修复识别工具失去焦点重置界面问题 @ABA2396 -- 修复启动时自动开启模拟器后无法自动停止 @ABA2396 -- 修复只自动开启模拟器时停不下来的情况 @moomiji -- 修复二次点击 StartButton1 时误触 StartButton2 @ABA2396 -- Mac UI 修复干员识别适配 @hguandl -- 修复路径检查错误 @ABA2396 -- Win UI SettingsView displayed incompletely @moomiji -- 修复开启 `启动MAA后自动开启模拟器` 报错 @ABA2396 -- perf: TryToStartEmulator 执行不更改按钮状态 #4533 @ABA2396 -- 修复开始唤醒任务提前结束,导致基建等任务点进商店的问题 @MistEO -- 修复 mac 上访问好友任务出错 +- 修复抽卡有时候进不去的问题 @MistEO ### 其他 -- Win UI 同时加载 API @ABA2396 -- 更新一图流上传接口 @MistEO -- 从 maa-website 转移文档 (#4545) @horror-proton -- add r2 release mirror @GalvinGao @MistEO -- Auto Tag Release PR (#4531) @MistEO -- 升级 macOS 编译环境,清理多余依赖 @hguandl -- 代码清理 @MistEO @hguandl @ABA2396 -- 修复 Win UI 绑定错误 @ABA2396 - -### For overseas - -#### Common - -- Added CI that automatically updates game resources, including all overseas clients resources (but needs to be manually triggered). If you want to create a pull request to update game resources, you can use \ -> `Actions` -> `res-update-game` -> `Run workflow` to update resources instead of manual update. @MistEO -- Fix the recognition error of recruiting senior operators @MistEO -- fix #4471: Add loading instructions for overseas clients resource files @hguandl - -#### YostarJP - -- Doc : Add EPISODE11 Depot (#4506) @wallsman -- Doc : JP Update EPISODE11「淬火煙塵」 (#4504) @wallsman - -#### YostarEN - -- Resolve recruit failure for Supporter @hguandl - -#### txwy - -- 繁中服 傀影肉鴿道具 (#4491) @vonnoq -- 繁中服 保全物件/傀影關卡識別 (#4489) @vonnoq - -### For develops - -**由于我们的文档正在迁移,为避免造成更多的 conflicts,近期新接口还请参考 Win UI 或 Mac UI 集成逻辑** - -- 新增抽卡功能,[集成参考](https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/f644f8c548568220b61955c0369c9ac6c7bceec4/src/MaaWpfGui/Main/AsstProxy.cs#L1662) @MistEO -- 肉鸽新增刷 `指路鳞` 选项,[集成参考](https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/f644f8c548568220b61955c0369c9ac6c7bceec4/src/MaaWpfGui/Main/AsstProxy.cs#L1588), [回调参考](https://github.com/MaaAssistantArknights/MaaAssistantArknights/blob/f644f8c548568220b61955c0369c9ac6c7bceec4/src/MaaWpfGui/Main/AsstProxy.cs#L774) @MistEO -- 干员 BOX 识别,潜能 改成 1-6 @MistEO -- 新增自动更新游戏资源 CI: `res-update-game` @MistEO -- Add Debug configuration (#4474) @dantmnf @MistEO +- 修正文档干员 box 识别潜能字段 为 [1,6] @MistEO +- 加快更新包构建速度 (#4517) @horror-proton +- 新增 CI,自动生成 changelog @MistEO +- 新增 CI,自动冒烟测试 (#4565) @MistEO +- 优化了一些 CI @MistEO