Skip to content

Commit

Permalink
Release v5.11.1 (MaaAssistantArknights#11450)
Browse files Browse the repository at this point in the history
  • Loading branch information
ABA2396 authored Dec 29, 2024
2 parents 7317087 + 447d6d0 commit c0a0657
Show file tree
Hide file tree
Showing 203 changed files with 9,830 additions and 830 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
github.event.pull_request.base.repo.full_name

needs: meta
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
arch: [aarch64, x86_64]
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/markdown-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ jobs:
with:
# 仅检查内部链接和 Github 相关链接
args: >
--verbose --no-progress --cache --max-cache-age 1d
--verbose --no-progress --cache --max-cache-age 1d
--exclude 'https?://.*'
--include 'https?://github\.com/.*'
--include 'https?://raw\.githubusercontent\.com/.*'
--include 'https?://user-images\.githubusercontent\.com/.*'
--exclude-path 'docs/zh-tw/manual/introduction/introduction_old.md'
--exclude-path 'docs/ja-jp/manual/introduction/introduction_old.md'
--exclude-path 'docs/zh-tw/manual/introduction/introduction_old.md'
--exclude-path 'docs/ja-jp/manual/introduction/introduction_old.md'
--exclude 'files/MAA_Runtime_Fix_Pwsh.ps1$'
-- './docs/**/*.md' './README.md'
- name: Comment (only for PR)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/optimize-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "dev"
paths:
- "resource/**/*.png"
- "docs/.vuepress/public/image/**"
- "docs/.vuepress/public/images/**"
- "website/apps/web/public/**"
- "website/apps/web/src/assets/links/**"
workflow_dispatch:
Expand Down
103 changes: 65 additions & 38 deletions .github/workflows/release-nightly-ota.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,59 +47,82 @@ jobs:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check for changes in dev branch
id: check_changes
- name: Checkout ref (if provided)
if: inputs.ref != ''
run: |
# Get the commit hash and date of the latest commit within the last 24 hours
$recent_commit = git log --since="24 hours ago" --pretty=format:"%H" -n 1
git checkout --progress --recurse-submodules ${{ inputs.ref }}
if (-not $recent_commit) {
Write-Output "No commits in the last 24 hours. Cancelling workflow..."
echo "cancel_run=true" >> $env:GITHUB_ENV
- name: Check for Changes and Set tag
id: set_tag
run: |
# Fetch the latest tag from the repository
$latest_tag = git describe --tags --abbrev=0
# Check for changes between the latest tag and HEAD
$recent_changes = git log "$latest_tag..HEAD" --oneline
if (-not $recent_changes) {
Write-Output "No commits. Cancelling workflow..."
Write-Output "cancel_run=true" >> $env:GITHUB_ENV
exit 0
} else {
Write-Output "Commits found within the last 24 hours. Continuing build..."
echo "cancel_run=false" >> $env:GITHUB_ENV
Write-Output "Recent commits: $recent_changes"
Write-Output "Commits found. Continuing build..."
Write-Output "cancel_run=false" >> $env:GITHUB_ENV
}
- name: Stop if no changes
if: env.cancel_run == 'true'
uses: andymckay/[email protected]
Write-Output "Previous Tag: $latest_tag"
Write-Output "latest_tag=$latest_tag" >> $env:GITHUB_OUTPUT
- name: Checkout ref
run: |
if ("${{ inputs.ref }}" -ne "") {
git checkout --progress --recurse-submodules ${{ inputs.ref || 'dev' }}
}
# Get the full description of the current commit
$described = git describe --tags --long --match 'v*'
Write-Output "New Described: $described"
$ids = $described -split "-"
- name: Install semver
run: |
npm install --global --progress semver
if ($ids.Length -eq 3) {
# Extract and parse the current version
$current_version = $ids[0].Substring(1)
$parts = $current_version -split '\.'
if ($parts.Length -ne 3) {
Write-Error "Invalid version format: $current_version. Expected 'major.minor.patch'."
exit 1
}
# Increment the patch version
$parts[2] = [int]$parts[2] + 1
$new_version = "$($parts[0]).$($parts[1]).$($parts[2])"
# Construct the new tag and pre_version
$ver = "v$new_version"
$pre_version = $ids[0]
$dist = "{0:D3}" -f [int]$ids[1]
Write-Output "pre_version=$pre_version" >> $env:GITHUB_OUTPUT
Write-Output "New Tag: $ver-alpha.1.d$dist.$($ids[2])"
Write-Output "tag=$ver-alpha.1.d$dist.$($ids[2])" >> $env:GITHUB_OUTPUT
- name: Set tag
id: set_tag
run: |
# pre_version是上一个公版,这里需要拉上一个tag,避免堆积过多commit
$latest_tag=$(git describe --tags --abbrev=0)
echo "latest_tag=$latest_tag" >> $env:GITHUB_OUTPUT
$described = $(git describe --tags --long --match 'v*')
$ids = $($described -split "-")
if ($ids.length -eq 3) {
$ver = "v$(semver --increment $ids[0].Substring(1))"
$pre_version = "$($ids[0])"
$dist = `printf "%03d"` $ids[1]
echo "tag=$ver-alpha.1.d$($dist).$($ids[2])" >> $env:GITHUB_OUTPUT
echo "pre_version=$pre_version" >> $env:GITHUB_OUTPUT
exit 0
}
if ($ids.length -eq 4) {
$dist = `printf "%03d"` $ids[2]
if ($ids.Length -eq 4) {
$dist = "{0:D3}" -f [int]$ids[2]
$pre_version = "$($ids[0])-$($ids[1])"
echo "pre_version=$pre_version" >> $env:GITHUB_OUTPUT
echo "tag=$pre_version.d$($dist).$($ids[3])" >> $env:GITHUB_OUTPUT
Write-Output "Pre Version: $pre_version"
Write-Output "pre_version=$pre_version" >> $env:GITHUB_OUTPUT
Write-Output "tag: $pre_version.d$dist.$($ids[3])"
Write-Output "tag=$pre_version.d$dist.$($ids[3])" >> $env:GITHUB_OUTPUT
exit 0
}
exit 1
- name: Stop if no changes
if: env.cancel_run == 'true'
uses: andymckay/[email protected]

- name: Push tag to main repo
id: push_main_tag
run: |
Expand All @@ -120,6 +143,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYTHONIOENCODING: "utf-8"

- name: Stop if no changes
if: steps.generate_changelog.outputs.cancel_run == 'true'
uses: andymckay/[email protected]

- name: Read Changelog to variable
id: read_changelog
uses: juliangruber/read-file-action@v1
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
## v5.11.1

### 新增 | New

* 适配界面主题「大荒」与「视相」 (#11449) @SherkeyXD
* 支持 XX-EX1 类型关卡名列表添加 @ABA2396
* 添加运行库安装脚本 @ABA2396

### 修复 | Fix

* StartButton1 ocrReplace syntax error in JP tasks.json @Constrat

### 文档 | Docs

* 更新文档 (#11430) @Rbqwow @SherkeyXD

### 其他 | Other

* MAA 启动相关改为全局配置 @ABA2396
* 界面设置改为全局配置 @ABA2396
* 热键改为全局配置 @ABA2396

## v5.11.0

### 没有摸鱼 | Highlight
Expand Down
17 changes: 17 additions & 0 deletions DependencySetup_依赖库安装.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@echo off
chcp 65001
setlocal enabledelayedexpansion

openfiles >nul 2>&1
if %errorlevel% neq 0 (
echo 正在获取管理员权限...
powershell -Command "Start-Process cmd.exe -ArgumentList '/c %~dpnx0' -Verb RunAs"
exit /b
)

winget install "Microsoft.VCRedist.2015+.x64" --override "/repair /passive /norestart" --uninstall-previous --accept-package-agreements --force
winget install "Microsoft.DotNet.DesktopRuntime.8" --override "/repair /passive /norestart" --uninstall-previous --accept-package-agreements --force

echo 运行库修复完成,请重启电脑后再次尝试运行 MAA。
echo The runtime library repair is complete. Please restart your computer and try running MAA again.
pause
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div align="center">

<img alt="LOGO" src="./docs/.vuepress/public/image/maa-logo_512x512.png" width="256" height="256" />
<img alt="LOGO" src="./docs/.vuepress/public/images/maa-logo_512x512.png" width="256" height="256" />

# MaaAssistantArknights

Expand Down Expand Up @@ -59,20 +59,20 @@ MAA 的意思是 MAA Assistant Arknights
<details><summary>话不多说,看图!</summary>

<picture>
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/image/zh-cn/readme/1-dark.png">
<img alt="zh1" src="./docs/.vuepress/public/image/zh-cn/readme/1-light.png">
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/images/zh-cn/readme/1-dark.png">
<img alt="zh1" src="./docs/.vuepress/public/images/zh-cn/readme/1-light.png">
</picture>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/image/zh-cn/readme/2-dark.png">
<img alt="zh2" src="./docs/.vuepress/public/image/zh-cn/readme/2-light.png">
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/images/zh-cn/readme/2-dark.png">
<img alt="zh2" src="./docs/.vuepress/public/images/zh-cn/readme/2-light.png">
</picture>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/image/zh-cn/readme/3-dark.png">
<img alt="zh3" src="./docs/.vuepress/public/image/zh-cn/readme/3-light.png">
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/images/zh-cn/readme/3-dark.png">
<img alt="zh3" src="./docs/.vuepress/public/images/zh-cn/readme/3-light.png">
</picture>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/image/zh-cn/readme/4-dark.png">
<img alt="zh4" src="./docs/.vuepress/public/image/zh-cn/readme/4-light.png">
<source media="(prefers-color-scheme: dark)" srcset="./docs/.vuepress/public/images/zh-cn/readme/4-dark.png">
<img alt="zh4" src="./docs/.vuepress/public/images/zh-cn/readme/4-light.png">
</picture>

</details>
Expand Down
101 changes: 101 additions & 0 deletions docs/.vuepress/public/files/MAA_Runtime_Fix_Pwsh.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# This file MUST use GBK encoding, whatever the system language is.
# You may do more testing, but at least it works like this for me.
# Fuck Microsoft.
# 修改请使用 GBK 编码保存。
# 如果能用 UTF-8 保存而不乱码,那就去做,我实在是研究不明白微软的屎了。
# 你或许想加一条 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 来解决问题。
# 但很神奇的,这根本不管用,甚至还会让中文汉字渲染重叠在一起。
# 我在 CMD 里面都能 chcp 65001 换成 UTF-8。
# 微软什么时候能把 PowerShell 7 集成到系统里。
# 我由衷的认为 Windows 中预装的 PowerShell 就是一坨屎,甚至不如 CMD。
# 用 PowerShell 写这东西真成为了一盘醋包的饺子了。

# 检查 PowerShell 脚本运行策略
# 我真理解不了这个运行策略的存在意义了,明明叫脚本运行策略,却可以用脚本修改。
# 我既可以在不提权的情况下允许所有脚本运行,也可以直接启动一个运行所有脚本运行的会话。
# 本脚本在测试时发现,在不修改策略且不提权的情况下也可以正常运行,只是在安装运行库时需要点安装程序的 UAC 弹窗。
# 而不修改策略且提权时反而因为脚本策略运行不了了,这是什么品种的管理员权限。
# $ExecutionPolicy = Get-ExecutionPolicy
# if ($ExecutionPolicy -eq 'Restricted' -or $ExecutionPolicy -eq 'AllSigned') {
# Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Write-Host "已修改当前用户的 PowerShell 脚本运行策略为 RemoteSigned 以便运行此脚本。"
# Write-Host "这只需运行一次,且理应不会产生较大的安全风险。"
# Write-Host "如果您对此有疑虑,请在脚本运行结束后,在 PowerShell 中运行以下命令将策略值清空。"
# Write-Host "Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope CurrentUser"
# Pause
# }

# 获取 UAC 权限并启动一个 RemoteSigned 脚本策略会话
If (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)) {
Write-Host "正在获取管理员权限..."
Start-Process powershell.exe "-ExecutionPolicy RemoteSigned -File `"$PSCommandPath`" -ArgumentList `"$PSCommandPath`"" -Verb RunAs
Exit
}

# 读取系统代理并应用
$Internet_Settings = Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings'
if ($Internet_Settings.ProxyEnable -eq 1) {
$env:HTTP_PROXY = "http://$($Internet_Settings.ProxyServer)"
$env:HTTPS_PROXY = "http://$($Internet_Settings.ProxyServer)"
Write-Host "已应用系统代理:$($Internet_Settings.ProxyServer)"
}
# else {
# Write-Host "未启用系统代理。"
# }
Remove-Variable -Name Internet_Settings

# 新建下载用临时文件夹
New-Item -Path "$env:TEMP" -Name "MAA_Runtime_Fix_Pwsh" -ItemType "Directory" | Out-Null

# 使用 BITS 下载运行库安装包
Write-Host "正在下载运行库安装包..."
# Start-Sleep -Seconds 1
Start-BitsTransfer -Source "https://aka.ms/vs/17/release/vc_redist.x64.exe" -Destination "$env:TEMP\MAA_Runtime_Fix_Pwsh\vc_redist.x64.exe"
Start-BitsTransfer -Source "https://builds.dotnet.microsoft.com/dotnet/WindowsDesktop/8.0.11/windowsdesktop-runtime-8.0.11-win-x64.exe" -Destination "$env:TEMP\MAA_Runtime_Fix_Pwsh\windowsdesktop-runtime-8.0.11-win-x64.exe"

# 卸载 vc++ 和 dotnet8
Write-Host ""
Write-Host "尝试调用 WinGet 卸载已安装的运行库..."
winget uninstall "Microsoft.VCRedist.2015+.x64" "Microsoft.DotNet.DesktopRuntime.8" --force --all-versions

# 安装 vc++
Write-Host ""
Write-Host "正在安装/修复 Microsoft Visual C++ 可再发行程序包..."
$vcProcess = Start-Process "$env:TEMP\MAA_Runtime_Fix_Pwsh\vc_redist.x64.exe" -ArgumentList '/repair', '/passive', '/norestart' -PassThru
$vcProcess.WaitForExit()

# 安装 dotnet8
Write-Host "正在安装/修复 .NET 桌面运行时 8..."
$dotnetProcess = Start-Process "$env:TEMP\MAA_Runtime_Fix_Pwsh\windowsdesktop-runtime-8.0.11-win-x64.exe" -ArgumentList '/repair', '/passive', '/norestart' -PassThru
$dotnetProcess.WaitForExit()

# 删除临时文件夹
Write-Host ""
Write-Host "正在清理临时文件..."
Remove-Item -Path "$env:TEMP\MAA_Runtime_Fix_Pwsh" -Recurse -Force

Write-Host "运行库修复完成,请再次尝试运行 MAA。"
Write-Host ""
Pause

# 使用 winget 安装/更新运行库并卸载旧版本
# winget install "Microsoft.VCRedist.2015+.x64" "Microsoft.DotNet.DesktopRuntime.8" --uninstall-previous --accept-package-agreements

# 使用 winget 下载运行库安装包
# winget download --id "Microsoft.VCRedist.2015+.x64" -d "$env:TEMP\MAA_Runtime_Fix_Pwsh\"
# winget download --id "Microsoft.DotNet.DesktopRuntime.8" -d "$env:TEMP\MAA_Runtime_Fix_Pwsh\"

# 不使用 winget 卸载 vc++
# 会进行卸载 但是卸不掉
# Get-Package -Name "Microsoft Visual C++ 2015-2022 Redistributable (x64) - *" | Uninstall-Package -Force

# 不使用 winget 卸载 dotnet8
# 会进行卸载 但是卸不掉
# Get-Package -Name "Microsoft Windows Desktop Runtime - 8.* (x64)" | Uninstall-Package -Force

# 下载安装包那里注释了一个睡一秒是因为本来下载文件的那个进度条会把上面输出过的所有内容都覆盖掉,上来就只能看到个下载进度条,别的啥也看不到。
# 但当我去掉新建文件夹时输出的一大坨东西之后,这行就能露出来了。
# 我建议每个人都去看一下 PowerShell 的 New-Item 新建文件夹能输出多大一坨玩意。
# 还有 PowerShell 弱智一样的进度条显示机制,非得搞个固定不透明一大坨的浮窗上去干什么,就不能和别人一样在命令底部显示吗。

# 再用 Pwsh 写脚本我就是傻逼。
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/en-us/develop/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ The formatting tool will automatically run every time you submit to ensure that
3. In Visual Studio, search for 'clang-format' in Tools-Options.
4. Click `Enable ClangFormat support` and select `Use custom clang-format.exe file` and choose the `clang-format.exe` located in Step 2.
![Enable clang-format in Visual Studio](/image/zh-cn/development-enable-vs-clang-format.png)
![Enable clang-format in Visual Studio](/images/zh-cn/development-enable-vs-clang-format.png)
You are all set with the clang-format integrated in Visual Studio supporting c++20 features!
Expand Down
4 changes: 2 additions & 2 deletions docs/en-us/develop/documentation-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ You can use the `<HopeIcon />` component to add icons in markdown. This componen
<HopeIcon icon="ic:round-home" color="#1f1e33"/>
```

<HopeIcon icon="/image/maa-logo_512x512.png" size="4rem" />
<HopeIcon icon="/images/maa-logo_512x512.png" size="4rem" />
```markdown
<HopeIcon icon="/image/maa-logo_512x512.png" size="4rem" />
<HopeIcon icon="/images/maa-logo_512x512.png" size="4rem" />
```
:::

Expand Down
Loading

0 comments on commit c0a0657

Please sign in to comment.