-
Notifications
You must be signed in to change notification settings - Fork 12
Release Protection
konodoki edited this page Aug 2, 2026
·
11 revisions
当前发布保护以完整 Mod 为单位。工具不再删除 Python class、中央 YAML 片段或单个模型文件。
schema: 1
id: com.example.dangerous_action
name: 高风险动作
version: 1.0.0
api: ">=4,<5"
enable: true
entrypoint: plugin:create_mod
visibility: protected
requires: []
conflicts: []
python_exports: []
runtime_requirements:
python: []
ros: []
system: []运行时仍正常加载;visibility 由发布工具解释。该字段必须显式填写。当前内置保护 Mod 是 com.bxi.back_flip、com.bxi.ballet 和 com.bxi.normal_depth;com.bxi.forward_flip 当前是 public。
python3 tools/sanitize_release.py \
--out /tmp/public_release \
--self-check临时额外排除公开 Mod:
python3 tools/sanitize_release.py \
--exclude com.example.customer_feature \
--out /tmp/public_release额外根可通过重复 --mod-root 指定。
- 从 Mod 根递归发现清单。
- 读取显式
requires。 - 从跨 Mod
routes.from/to/event、actions.from/event和nodes.states推导隐式依赖。 - 收集 protected 和命令行排除项。
- 验证公开 Mod 依赖闭包不包含要删除的 Mod。
- 复制仓库并忽略版本库、Wiki、构建目录和缓存。
- 删除被保护 Mod 的完整目录和私有同步工具。
-
--self-check重新发现输出 Mod,确认集合准确。
公开 Mod 依赖保护 Mod 时会直接失败。应调整依赖方向或把共享资源拆成 public 的无状态资源 Mod。
.github/workflows/sync_public_main.yml 在 dev push 或手动触发时生成并自检公开树,同步到 public/main-sync,创建/更新面向 main 的 PR 并尝试合并。
仓库 secret PUBLIC_RELEASE_TOKEN 需要 Contents、Pull requests 和 Workflows 写权限。
find /tmp/public_release/src/bxi_example_py_elf3/mods -name mod.yaml -print
test ! -d /tmp/public_release/src/bxi_example_py_elf3/mods/com.bxi.back_flip
test ! -d /tmp/public_release/src/bxi_example_py_elf3/mods/com.bxi.ballet基础动作包必须完整保留;工具不会从一个 Mod 内裁剪个别状态。