fix(packaging): 修复 Windows 安装与固件打包并完善客户端文案
构建客户端 / 检查(类型 + 单元测试) (push) Canceled after 0s
构建客户端 / Linux x64(deb + AppImage) (push) Canceled after 0s
构建客户端 / Windows x64(NSIS 安装包) (push) Canceled after 0s
构建客户端 / macOS 通用(.app + .dmg) (push) Canceled after 0s

- fix(installer): 修复低完整性产物无法写入临时目录的问题,并在 CI 打包前后检查完整性标签
- fix(firmware): 从本次 Cargo ELF 打包并同步配套镜像,修正短目录说明与 LLVM 搜索顺序
- fix(installer): 修复中文完成页和页眉遮挡,侧栏使用等比缩放的原始 Logo
- style(client): 应用图标增加圆角,统一“裁判系统客户端”命名
- fix(config): 安装提示改用可选本地热点配置,排除 Wi-Fi 凭据
- docs: 润色项目说明并统一裁判系统术语
- test(packaging): 补充 Windows 完整性和固件打包回归,覆盖外部输出目录、旧镜像与重复生成

验证:Windows NSIS 构建及原生页面预览;通用与本地安装配置编译;固件 release 构建、重复打包和客户端离线校验;6 项固件打包回归与 Windows 权限回归;git diff --check。未执行实机烧录。
This commit is contained in:
2026-10-21 09:25:17 +08:00
parent 6a0eb14b28
commit 054379dc64
52 changed files with 1070 additions and 280 deletions
+19 -5
View File
@@ -51,19 +51,33 @@ try {
$espClang = Join-Path $env:USERPROFILE '.rustup\toolchains\esp-1.97.0.0\xtensa-esp32-elf-clang\esp-clang\bin'
if (Test-Path -LiteralPath (Join-Path $espClang 'libclang.dll')) {
$env:LIBCLANG_PATH = $espClang
if (-not ($env:PATH -split ';' | Where-Object { $_ -eq $espClang })) {
$env:PATH = $espClang + ';' + $env:PATH
}
# An existing entry can be behind another LLVM installation. Move it
# to the front so libclang-cpp.dll and the runtime match libclang.dll.
$otherPaths = @($env:PATH -split ';' | Where-Object { $_ -ne $espClang })
$env:PATH = (@($espClang) + $otherPaths) -join ';'
}
$env:CARGO_WORKSPACE_DIR = (Get-Location).Path
$env:ESP_IDF_GLOB_BASE = (Get-Location).Path
$env:ESP_IDF_GLOB_PARTITIONS = 'partitions.csv'
& cargo build --release --locked @CargoArgs
$firmwareElf = $null
if ($Package) {
# Use Cargo's actual artifact path, including --target-dir / --config
# overrides, rather than guessing where this build wrote its ELF.
& cargo build --release --locked --message-format=json-render-diagnostics @CargoArgs | ForEach-Object {
$message = $_ | ConvertFrom-Json
if ($message.reason -eq 'compiler-artifact' -and $message.target.name -eq 'esp32' -and $message.executable) {
$firmwareElf = $message.executable
}
}
} else {
& cargo build --release --locked @CargoArgs
}
if ($LASTEXITCODE -ne 0) { throw "cargo build failed (exit $LASTEXITCODE)." }
if ($Package) {
if (-not $firmwareElf) { throw 'Cargo did not report the esp32 firmware ELF; refusing to package old images.' }
$python = Get-Command python -ErrorAction SilentlyContinue
if ($null -eq $python) {
throw '-Package requires Python 3 on PATH (used by scripts/package_firmware.py).'
@@ -76,7 +90,7 @@ try {
$info = Get-Content -LiteralPath 'version.json' -Raw | ConvertFrom-Json
$versionArgs = @('--version', "v$($info.version)+$($info.build)")
}
& python scripts/package_firmware.py --firmware target/firmware --name 'RMIC 图传固件' @versionArgs
& python scripts/package_firmware.py --firmware target/firmware --elf $firmwareElf --name 'RMIC 图传固件' @versionArgs
if ($LASTEXITCODE -ne 0) { throw "package_firmware.py failed (exit $LASTEXITCODE)." }
}
} finally {