@jixoai/gh-runner 0.0.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/dist/main.mjs +1647 -0
- package/dist/ui/demo.js +194 -0
- package/dist/ui/index.html +599 -0
- package/package.json +55 -6
- package/index.js +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 jixoai
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @jixoai/gh-runner
|
|
2
|
+
|
|
3
|
+
菜单栏(托盘)工具:在一台 Mac 或 Windows 机器上管理多台 GitHub Actions self-hosted runner——
|
|
4
|
+
自动发现、表单注册(**下载官方最新包 / 导入本地包**)、一键启动/关闭、按运行日志实时分析最近一个
|
|
5
|
+
作业(动作)的成功/失败。
|
|
6
|
+
|
|
7
|
+
基于 [opentray](https://github.com/jixoai/opentray)(托盘 + appMode WebView 窗口 + 原生对话框)。
|
|
8
|
+
|
|
9
|
+
## 使用
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx @jixoai/gh-runner # 或:pnpm dlx @jixoai/gh-runner / npm i -g @jixoai/gh-runner && gh-runner
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
启动后菜单栏出现 `▶N` 图标(N=在跑数,作业中带 `↻M`),控制面板窗口自动打开。
|
|
16
|
+
|
|
17
|
+
- **自动发现**:扫描配置的 `searchDirs`(默认 macOS `/Volumes/bnqkl/Users/kzf`;Windows
|
|
18
|
+
`C:\actions-runner` 与用户目录)下所有含 `.runner` 的子目录。外部终端/launchd 启动的
|
|
19
|
+
runner 也会被识别(「外部」徽章),可查看状态与日志分析。
|
|
20
|
+
- **注册新实例**:`+ 注册新实例` → 填实例目录(空目录)、名称、org 页面生成的一次性 Token、
|
|
21
|
+
work 目录 → 在「分发包」中选择来源:
|
|
22
|
+
- `⤓ 最新`:从 [actions/runner](https://github.com/actions/runner/releases) 官方 release
|
|
23
|
+
下载当前平台最新包(带进度条,缓存到 `gh-runner/packages/`);
|
|
24
|
+
- `导入…`:系统文件选择框选择本地已有包(`tar.gz` / `zip`);
|
|
25
|
+
- 选择列表中此前下载/导入的任意包。
|
|
26
|
+
解包 →(macOS)去隔离 → `config.sh`(Windows 走 `Runner.Listener configure`)注册 → 自动启动。
|
|
27
|
+
- **启动/停止**:卡片按钮。作业中强停会弹确认(作业将被 GitHub 标记为失败)。
|
|
28
|
+
- **日志分析**:右侧面板实时滚动所选实例的 `_diag` 控制台行;绿=成功、红=失败、蓝=作业开始,
|
|
29
|
+
时间戳恒为中性灰。卡片上常驻「最近动作」的结果与耗时。
|
|
30
|
+
- **托盘菜单**:每实例直达(状态一览)、打开面板、退出。
|
|
31
|
+
|
|
32
|
+
受管 runner 以独立进程运行:退出本工具不会停掉 runner(与终端里跑等价),下次启动自动重连。
|
|
33
|
+
|
|
34
|
+
## 平台支持
|
|
35
|
+
|
|
36
|
+
| | macOS | Windows |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| 托盘 + WebView 窗口 | ✅ WKWebView | ✅ WebView2 |
|
|
39
|
+
| 包格式 | tar.gz / zip | zip / tar.gz |
|
|
40
|
+
| 注册入口 | `config.sh` | `Runner.Listener configure` |
|
|
41
|
+
| 启动入口 | `run.sh` | `Runner.Listener.exe run` |
|
|
42
|
+
| 进程发现/终止 | pgrep + lsof(cwd) / 进程组信号 | PowerShell CIM(ExecutablePath) / `taskkill /T` |
|
|
43
|
+
|
|
44
|
+
Linux:opentray 的 ext-webview/dialog 不发布 Linux 原生运行时,暂不支持。
|
|
45
|
+
|
|
46
|
+
## 开发与验证
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pnpm install
|
|
50
|
+
pnpm typecheck && pnpm test # 单测 + mock-runner 全链路 E2E(隔离 HOME,不触碰真实 runner)
|
|
51
|
+
pnpm dev # 无头:只读打印真实实例状态快照
|
|
52
|
+
pnpm smoke # 起真实托盘+窗口,验证 host→page→host 闭环 → /tmp/gh-runner-smoke.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
架构与实测教训(WKWebView evaluate 体积上限、.runner BOM、spawn 失败三律、lsof realpath 等)
|
|
56
|
+
见 [ARCHITECTURE.md](ARCHITECTURE.md)。
|
|
57
|
+
|
|
58
|
+
## 发布
|
|
59
|
+
|
|
60
|
+
推送 `v*` 标签触发 `release.yml`:CI 门禁 → 构建产物 → npm 可信发布(OIDC,environment
|
|
61
|
+
`npm-publish`,带 provenance)。
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
MIT
|