feat(match): 同步比赛计时与装甲板扣血许可
- feat(client): 增加裁判比赛计时、技术暂停与选手端局域网同步 - feat(armor): 红蓝共用通用固件,按客户端选队并显示网络连接状态 - feat(armor): 仅在对局进行中允许扣血,其他阶段保留受击闪烁 - feat(client): 将计时置于血条中间并增加开赛前五秒全屏动画 - fix(client): 修复连续血条、对手镜像和图传断连灰度遮罩 - fix(client): 统一界面中文字体并整理各页面文案 - fix(maintenance): 备份迁移装甲板分区,恢复 SDK 构建与固件打包 - refactor(repo): 按 armor、vt 和 client 整理工程与脚本,移除旧参考实现 - test: 补充线路、受击许可、回环 UDP、维护和 HUD 验证 - docs: 同步构建、协议、比赛控制和硬件验证边界 验证:前端构建与 19 项相关测试通过;核心 91 项单元测试与 2 项回环 UDP 集成测试通过;装甲板规则 25 项、线路 26 项、Tauri 51 项测试通过;独立探测器 5 项与目录回归 4 项通过。完成 C3 两组阈值实际编译、导出与 ZIP 校验,检查 900×600 / 1280×720 页面、倒计时和随包中文字体。 未执行烧录、板上运行、跨电脑广播或硬件稳定性验证。
This commit is contained in:
581 files changed
+6596
-7683
No files matched your search
@@ -1,4 +1,4 @@
|
||||
# 构建桌面客户端(desktop/,Tauri v2 + React)。
|
||||
# 构建桌面客户端(client/,Tauri v2 + React)。
|
||||
#
|
||||
# 产物都挂在这次运行下面(Actions 页面直接下载),保留 14 天:
|
||||
# Linux x64 deb + AppImage RMIC-2026_<版本>_amd64.deb / .AppImage ← 默认每次编
|
||||
@@ -6,7 +6,7 @@
|
||||
# macOS 通用 .app + .dmg arm64 与 x86_64 合成一个包 ← 还没有机器,手动勾选才编
|
||||
#
|
||||
# ── 触发 ─────────────────────────────────────────────────────────────────────
|
||||
# * push 到 main/master —— 只认 desktop/、protocol/ 与本文件的改动,改固件不会
|
||||
# * push 到 main/master —— 只认 client/、vt/protocol/ 与本文件的改动,改固件不会
|
||||
# 白占 runner
|
||||
# * 打 v* tag、开 PR
|
||||
# * 手动 Run workflow:逐个平台勾选,不进 paths 过滤("就想编一次"走它)
|
||||
@@ -46,7 +46,7 @@
|
||||
# Failed to restore: getCacheEntry failed: connect ETIMEDOUT 172.18.0.2:37315
|
||||
# setup-node 的 cache 每次要干等 4 分 39 秒才放弃(两个 job 各一次)。
|
||||
# 等缓存能从容器访问到了再加回来,写法就是:
|
||||
# setup-node 的 with 里加:cache: pnpm / cache-dependency-path: desktop/pnpm-lock.yaml
|
||||
# setup-node 的 with 里加:cache: pnpm / cache-dependency-path: client/pnpm-lock.yaml
|
||||
# 各 job 里加:
|
||||
# - uses: actions/cache@v4
|
||||
# with:
|
||||
@@ -54,7 +54,7 @@
|
||||
# ~/.cargo/registry/index
|
||||
# ~/.cargo/registry/cache
|
||||
# ~/.cargo/git/db
|
||||
# key: ${{ runner.os }}-cargo-registry-${{ hashFiles('protocol/Cargo.lock', 'desktop/core/Cargo.lock', 'desktop/src-tauri/Cargo.lock') }}
|
||||
# key: ${{ runner.os }}-cargo-registry-${{ hashFiles('vt/protocol/Cargo.lock', 'client/core/Cargo.lock', 'client/src-tauri/Cargo.lock') }}
|
||||
# restore-keys: ${{ runner.os }}-cargo-registry-
|
||||
# 4. 平台开关只用 github.event.inputs,**不用仓库变量**。2026-10-15 那次 Windows# runner 明明在线、job 也确实派给了它(它自己的日志里写着
|
||||
# "Runner labels: windows-latest, windows-2025, windows-2022"),产物却一直是
|
||||
@@ -94,20 +94,14 @@
|
||||
# job 开始时检查进程级别;打包前修正输出目录与 exe 标签;上传前只读复查。
|
||||
#
|
||||
# ── 三个平台都显式写 --target,这不是啰嗦 ────────────────────────────────────
|
||||
# desktop/.cargo/config.toml 里钉着 `target = "aarch64-apple-darwin"`(本机开发用;
|
||||
# 它存在的理由是 desktop/ 嵌在固件目录树里,不然会继承根目录那份
|
||||
# xtensa-esp32s3-espidf 的交叉编译配置)。CI 上不覆盖它,Linux 与 Windows 的 runner
|
||||
# client/.cargo/config.toml 里钉着 `target = "aarch64-apple-darwin"`(本机开发默认值)。
|
||||
# 客户端与两个固件工程并列,不继承固件配置。CI 上不覆盖默认目标,Linux 与 Windows 的 runner
|
||||
# 会去编 macOS 的目标,然后在依赖深处以 libc 找不到 MAP_FAILED 这类形式失败。
|
||||
# 所以每个 job 都把真正的目标交两遍:CARGO_BUILD_TARGET 给裸 cargo(测试)用,
|
||||
# --target 给 tauri build 用(打包路径也跟着它走)。
|
||||
#
|
||||
# ── 还有一条:仓库根目录的 rust-toolchain.toml 钉的是 `esp` ─────────────────
|
||||
# 那是给 ESP32 固件的定制工具链,CI 上没有、也不打算装(espup 要下几百 MB)。
|
||||
# rustup 是按**当前目录**往上找 rust-toolchain.toml 的:
|
||||
# * desktop/** 有自己的 rust-toolchain.toml(stable),所以那里的 cargo 直接可用;
|
||||
# * protocol/ 没有,会一路找到根目录那个 esp —— 所以那条测试写成 `cargo +stable`,
|
||||
# 显式越过它。
|
||||
# 任何在仓库根目录直接跑 cargo 的步骤都会去要 esp 工具链,别加。
|
||||
# vt/ 和 armor/ 各自固定 ESP 工具链;client/ 固定 stable。
|
||||
# vt/protocol/ 的主机测试必须显式 +stable,并清空继承自 vt/ 的 build-std。
|
||||
#
|
||||
# ── 没做的事 ────────────────────────────────────────────────────────────────
|
||||
# 不签名、不公证:Windows 的 exe 与 macOS 的 app 在别人机器上会被 SmartScreen /
|
||||
@@ -125,13 +119,17 @@ on:
|
||||
# GitHub 语义下 tag 推送不受 paths 过滤影响;如果你们的 Gitea 版本把 tag 也
|
||||
# 一起过滤掉了(打 tag 不触发),把这三行 paths 删掉即可。
|
||||
paths:
|
||||
- "desktop/**"
|
||||
- "protocol/**"
|
||||
- "client/**"
|
||||
- "vt/protocol/**"
|
||||
- "scripts/version.mjs"
|
||||
- "scripts/test-repository-layout.py"
|
||||
- ".github/workflows/build-client.yml"
|
||||
pull_request:
|
||||
paths:
|
||||
- "desktop/**"
|
||||
- "protocol/**"
|
||||
- "client/**"
|
||||
- "vt/protocol/**"
|
||||
- "scripts/version.mjs"
|
||||
- "scripts/test-repository-layout.py"
|
||||
- ".github/workflows/build-client.yml"
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
@@ -220,7 +218,7 @@ jobs:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: 前端依赖(严格按 lock 装)
|
||||
working-directory: desktop
|
||||
working-directory: client
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
# 版本号与改动日志是从 git 历史算出来的(scripts/version.mjs)。这一步确认
|
||||
@@ -229,12 +227,20 @@ jobs:
|
||||
- name: 版本一致性(version.json 是否跟上了 git 历史)
|
||||
run: node scripts/version.mjs --check
|
||||
|
||||
- name: 装 Python(目录回归)
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: 目录、链接与版本生成回归
|
||||
run: python3 scripts/test-repository-layout.py
|
||||
|
||||
- name: 类型检查(tsc --noEmit)
|
||||
working-directory: desktop
|
||||
working-directory: client
|
||||
run: pnpm run check
|
||||
|
||||
- name: 前端构建(vite)
|
||||
working-directory: desktop
|
||||
working-directory: client
|
||||
run: pnpm build
|
||||
|
||||
- name: 装 Rust(stable)
|
||||
@@ -242,15 +248,14 @@ jobs:
|
||||
with:
|
||||
targets: x86_64-unknown-linux-gnu
|
||||
|
||||
# protocol 没有自己的 rust-toolchain.toml,会被根目录那个 `esp` 接住,
|
||||
# 所以这里必须 +stable 显式指定。
|
||||
# protocol 继承 vt/ 的 ESP 工具链,主机测试显式使用 stable。
|
||||
- name: protocol 单元测试(15)
|
||||
working-directory: protocol
|
||||
run: cargo +stable test --locked --target x86_64-unknown-linux-gnu
|
||||
working-directory: vt/protocol
|
||||
run: cargo +stable test --locked --target x86_64-unknown-linux-gnu --config 'unstable.build-std=[]'
|
||||
|
||||
# core 在 desktop/ 下面,desktop/rust-toolchain.toml 已经是 stable,不用 +stable。
|
||||
# core 在 client/ 下面,client/rust-toolchain.toml 已经是 stable,不用 +stable。
|
||||
- name: cam-core 单元测试(80)
|
||||
working-directory: desktop/core
|
||||
working-directory: client/core
|
||||
run: cargo test --locked --target x86_64-unknown-linux-gnu
|
||||
|
||||
# ───────────────────────────────────────────────────────────────────────────
|
||||
@@ -327,7 +332,7 @@ jobs:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: 前端依赖(严格按 lock 装)
|
||||
working-directory: desktop
|
||||
working-directory: client
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
# 上面 apt 装了 ffmpeg,所以 recording.rs 里那几条"真的起 ffmpeg 并读回帧数"
|
||||
@@ -335,12 +340,12 @@ jobs:
|
||||
# 如果这台 runner 上它们长期不稳定,删掉这一步即可 —— 它们不在守门 job 里,
|
||||
# 不影响另外两个平台的产物。
|
||||
- name: Tauri 后端单元测试(30)
|
||||
working-directory: desktop/src-tauri
|
||||
working-directory: client/src-tauri
|
||||
run: cargo test --locked --target ${{ env.TARGET }}
|
||||
|
||||
# beforeBuildCommand(pnpm build)由 tauri 自己跑,这里不用再 build 一次。
|
||||
- name: 打包(tauri build)
|
||||
working-directory: desktop
|
||||
working-directory: client
|
||||
run: pnpm tauri build --target ${{ env.TARGET }} --bundles deb,appimage
|
||||
|
||||
- name: 上传产物
|
||||
@@ -351,8 +356,8 @@ jobs:
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
path: |
|
||||
desktop/src-tauri/target/${{ env.TARGET }}/release/bundle/deb/*.deb
|
||||
desktop/src-tauri/target/${{ env.TARGET }}/release/bundle/appimage/*.AppImage
|
||||
client/src-tauri/target/${{ env.TARGET }}/release/bundle/deb/*.deb
|
||||
client/src-tauri/target/${{ env.TARGET }}/release/bundle/appimage/*.AppImage
|
||||
|
||||
# ───────────────────────────────────────────────────────────────────────────
|
||||
# Windows x64:NSIS 安装包
|
||||
@@ -392,7 +397,7 @@ jobs:
|
||||
|
||||
- name: 检查 Windows 打包进程完整性
|
||||
shell: pwsh
|
||||
run: ./desktop/scripts/prepare-windows-bundle.ps1 -CheckProcessOnly
|
||||
run: ./client/scripts/prepare-windows-bundle.ps1 -CheckProcessOnly
|
||||
|
||||
# 宿主模式的 Windows runner 上,PATH 里的 `bash` 是 C:\Windows\System32\bash.exe
|
||||
# —— WSL 的启动器,而 WSL 在 runner 账户下起不来,报 E_ACCESSDENIED(日志里是
|
||||
@@ -473,7 +478,7 @@ jobs:
|
||||
pnpm --version
|
||||
|
||||
- name: 前端依赖(严格按 lock 装)
|
||||
working-directory: desktop
|
||||
working-directory: client
|
||||
shell: pwsh
|
||||
# 这台 runner 的 job 跑在低完整性沙箱里(见文件头第 5 条),standalone 的
|
||||
# pnpm 到"把包装进 virtual store"那一步会直接栈溢出:
|
||||
@@ -497,16 +502,16 @@ jobs:
|
||||
# 也跟着 LOCALAPPDATA 走,见上面 job env),所以这台 runner 要能访问 GitHub
|
||||
# (离线环境改成 --bundles msi 也一样要下 WiX)。
|
||||
- name: 打包(tauri build)
|
||||
working-directory: desktop
|
||||
working-directory: client
|
||||
run: pnpm tauri build --target ${{ env.TARGET }} --bundles nsis
|
||||
|
||||
- name: 检查安装包与主程序完整性标签
|
||||
working-directory: desktop
|
||||
working-directory: client
|
||||
shell: pwsh
|
||||
run: ./scripts/prepare-windows-bundle.ps1 -CheckOnly
|
||||
|
||||
- name: Windows 安装包权限回归(不安装应用)
|
||||
working-directory: desktop
|
||||
working-directory: client
|
||||
shell: pwsh
|
||||
run: ./scripts/test-windows-bundle.ps1
|
||||
|
||||
@@ -517,7 +522,7 @@ jobs:
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
path: |
|
||||
desktop/src-tauri/target/${{ env.TARGET }}/release/bundle/nsis/*.exe
|
||||
client/src-tauri/target/${{ env.TARGET }}/release/bundle/nsis/*.exe
|
||||
|
||||
# ───────────────────────────────────────────────────────────────────────────
|
||||
# macOS 通用包:.app + .dmg
|
||||
@@ -560,13 +565,13 @@ jobs:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: 前端依赖(严格按 lock 装)
|
||||
working-directory: desktop
|
||||
working-directory: client
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
# 只想要当前架构、想省一半编译时间的话,把 --target 换成 aarch64-apple-darwin
|
||||
# (Apple Silicon 的 runner)并去掉上面 targets 里的 x86_64 即可。
|
||||
- name: 打包(tauri build)
|
||||
working-directory: desktop
|
||||
working-directory: client
|
||||
run: pnpm tauri build --target ${{ env.TARGET }} --bundles app,dmg
|
||||
|
||||
# 第二行是兜底:不同 tauri-cli 版本给通用包放的目录略有差异,宁可多写一行,
|
||||
@@ -578,5 +583,5 @@ jobs:
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
path: |
|
||||
desktop/src-tauri/target/${{ env.TARGET }}/release/bundle/dmg/*.dmg
|
||||
desktop/src-tauri/target/*/release/bundle/dmg/*.dmg
|
||||
client/src-tauri/target/${{ env.TARGET }}/release/bundle/dmg/*.dmg
|
||||
client/src-tauri/target/*/release/bundle/dmg/*.dmg
|
||||
Reference in new issue
Block a user