hololake-platform/docs/ops/GITEA-ACTIONS-RUNNER-WINDOWS-INTERNAL.md
Guanghu Domestic Migration dd131ff814
Some checks are pending
Build Windows Internal Installer / Build Windows x64 internal installer (push) Waiting to run
chore: import sanitized domestic snapshot for REPO-008
Source snapshot: 789bd691f530f915fc870bf72ecb7c96c5d5101c
2026-07-17 16:01:12 +08:00

163 lines
3.2 KiB
Markdown

# Gitea Actions Runner · Windows 内测安装包构建
> 状态: RUNNER_REQUIRED
>
> 适用仓库: `bingshuo/hololake-platform`
>
> 工作流: `.github/workflows/build-windows-manual.yml`
>
> 当前用途: 生成 `Guanghu-Windows-x64-internal` 内测安装包 artifact
## 1 · 当前问题
`Build Windows Internal Installer` 工作流已经进入仓库,但 Gitea Actions 页面显示:
```text
No matching online runner with label: ubuntu-latest
```
这表示问题不在应用源码,也不在 Windows 安装包工作流本身,而是服务器当前没有在线 Gitea Actions runner 接收 `ubuntu-latest` 标签的任务。
## 2 · 为什么先用 ubuntu-latest
本工作流当前使用 Linux runner 交叉构建 Windows x64 NSIS 内测安装包:
```yaml
runs-on: ubuntu-latest
```
原因:
```text
1. 服务器只需要一台 Linux runner 就能先产出 Windows NSIS 内测包。
2. 不要求 Windows 代码签名证书。
3. 不要求 Windows 桌面机器长期在线。
4. 比正式 Windows runner 更容易先补齐。
```
注意:这是内测 unsigned installer 路线,不是正式发布链。
## 3 · 最小 runner 要求
```yaml
runner:
label: ubuntu-latest
os: linux
arch: x64
disk: "80GB+ recommended"
memory: "4GB minimum, 8GB recommended"
network: "must reach guanghubingshuo.com and public package registries"
```
工作流会自动安装:
```text
nsis
lld
llvm
clang
cargo-xwin
Node.js 22
pnpm 10
Rust x86_64-pc-windows-msvc target
```
## 4 · 服务器补齐步骤
在运行 Gitea 的服务器或独立构建机上安装并启动 `act_runner`
示例流程:
```bash
# 1. 安装 runner 二进制
# 按服务器系统选择 Gitea act_runner 官方 release。
# 2. 注册 runner
act_runner register \
--instance https://guanghubingshuo.com/code \
--token <GITEA_ACTIONS_RUNNER_REGISTRATION_TOKEN> \
--name hololake-linux-runner-01 \
--labels ubuntu-latest:host
# 3. 启动 runner
act_runner daemon
```
生产建议用 systemd 托管:
```ini
[Unit]
Description=Gitea Actions Runner
After=network.target
[Service]
ExecStart=/usr/local/bin/act_runner daemon --config /etc/act_runner/config.yaml
WorkingDirectory=/var/lib/act_runner
Restart=always
User=act-runner
[Install]
WantedBy=multi-user.target
```
## 5 · 注册 token 放哪里
不要把 runner 注册 token 写入仓库。
token 应从 Gitea 管理界面获取:
```text
Repository / Organization / Site Admin
→ Actions
→ Runners
→ Create or registration token
```
token 只在服务器注册 runner 时使用。
## 6 · 验证方式
runner 启动后,进入:
```text
https://guanghubingshuo.com/code/bingshuo/hololake-platform/actions
```
确认 `build-windows-manual.yml` 左侧不再显示:
```text
No matching online runner with label: ubuntu-latest
```
然后重新运行:
```text
Build Windows Internal Installer
```
成功后 artifact 名称应为:
```text
Guanghu-Windows-x64-internal
```
其中包含:
```text
*-setup.exe
```
## 7 · 后续正式发布链
内测 runner 跑通后,再补正式链:
```text
1. Windows Authenticode 代码签名证书
2. Tauri updater signing key
3. 正式 release workflow
4. 安装包 smoke test
5. 自有更新源 latest.json
```
正式发布前不要把该内测包描述为“已签名正式版”。