72 lines
3.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: hololake-internal-release-packaging
description: Build, validate, archive, and hand off repeatable HoloLake Era internal installers for macOS and Windows.
route_id: HLP-SKILL-RELEASE-001
---
# HoloLake Era 内测安装包技能
当任务包含“打包新版”“生成 Mac/Windows 安装包”“把安装包放到桌面”或“恢复上次打包方法”时使用本技能。
## 唯一版本源
`src-tauri/tauri.conf.json``version` 是内测构建唯一版本源。`package.json``src-tauri/Cargo.toml` 应在版本提交中同步更新。构建脚本会拒绝 `HOLOLAKE_VERSION` 与配置版本不一致的请求,避免文件名、应用版本与仓库状态分叉。
## 固定入口
```bash
pnpm test:internal-release
pnpm package:internal:macos
pnpm package:internal:windows
```
- macOS 必须在 Apple Silicon Mac 上执行,产物默认进入 `artifacts/internal/<version>/`
- Windows 必须在 `JD-FD-PRIMARY` Linux 构建节点执行。脚本使用 `cargo-xwin` 生成 x86-64 Windows 本体,再使用 NSIS 生成安装程序。
- 京东节点使用 `scripts/cargo-config-jd.toml` 的国内稀疏索引;不要临时改回境外 crates.io 下载路径。
## 构建前检查
1. 工作树干净,当前分支包含目标 UI 和资源。
2. `tauri.conf.json``Cargo.toml``package.json` 版本一致。
3. 运行相关测试、lint、TypeScript/Vite 构建。
4. 确认公共研发入口和 GLS 文件已经进入源码:
- `https://guanghulab.com/fifth-domain/bingshuo/hololake-platform`
- `src-tauri/resources/public-architecture/gls-system-architecture.json`
5. 不把服务器密钥、邮箱授权码、令牌或私人域内容写入仓库和安装包。
## 强制验收
`scripts/verify-internal-package-content.mjs` 是发布硬门:
- 必须找到公共研发仓库标记;
- 必须找到 `GLS-SYS-ARCH-001`
- 发现私人域标记立即失败;
- Mac 必须通过 `codesign --verify --deep --strict``hdiutil verify`
- Windows 载荷必须为 `PE32+ x86-64`NSIS 安装包必须存在;
- 每个安装包必须生成同名 `.sha256`,回传后再次校验。
内测 Mac 包是 ad-hoc 签名、未公证Windows 包在没有商业证书时未做 Authenticode 签名。交付时必须明确说明,不能描述成正式签名发行版。
## Windows 构建恢复顺序
1. `pnpm install --frozen-lockfile`
2. Tauri `--no-bundle` + `cargo-xwin` 交叉编译 Windows x64 本体
3. 将应用、本地图标、MCP、Agent 文档和公共 GLS 资源组成 stage
4. `scripts/windows-installer.nsi` 生成单用户 NSIS 安装包
5.`dist` 与 stage 运行内容校验
6. 生成 SHA-256并归档到服务器的版本目录
Linux 上的 Tauri CLI 不提供 `nsis` bundle target。不要再次尝试 `tauri build --bundles nsis`这正是本仓库将“交叉编译”和“NSIS 封装”拆开的原因。
## 故障护栏
- `No matching runner`:是 runner/标签状态,不是应用源码错误;可直接登录已授权的 JD 节点运行同一脚本。
- crates.io 或 Rust 下载过慢:保留 rsproxy 配置和独立 `CARGO_HOME`
- NSIS 找不到图标或 stage所有传给 NSIS 的路径必须是绝对路径。
- Windows 链接器报告缺少外部 PDB 的 `LNK4099`:交叉编译的调试信息警告;只有最终链接失败或没有生成 PE32+ x64 本体才算失败。
- 产物已生成但未回传:不算完成;服务器归档、桌面回传、二次校验是同一个闭环。
## 仓库回写
每次修正构建方法后,将脚本、技能文档和验证结果提交到国内主仓库。发布技能属于 `bingshuo/hololake-platform`,不要写入 REPO-004 零件库。线上主分支能够读到本技能后,才算方法完成沉淀。