feat: 拆分 macOS 架构安装包并内置浏览器运行时

将 macOS 安装包拆分为 arm64 与 amd64 两个独立产物,每个安装包只携带对应架构的服务、托盘程序、Playwright driver 和 Chromium。

调整桌面端 CI,在构建阶段预下载并组装 Playwright runtime;服务启动时按当前进程架构解析 runtime 根目录,避免安装后联网下载 Chromium。

移除 Windows/macOS 安装阶段的 browser-install 调用和托盘中的安装/修复 Chromium 菜单,保留 Linux 安装脚本的既有流程。

升级 Playwright Go 依赖到 v0.6100.0,并迁移导入路径;仅按本次授权修改 CAPTCHA 相关文件的 import 行,不改变 CAPTCHA 行为。

验证:go test ./...、go vet ./...、macOS 安装脚本语法、Workflow YAML 语法、Windows amd64 交叉编译及两个 macOS pkg 的本地组装。
This commit is contained in:
Christ committed 2026-08-12 01:09:59 +08:00
1 parent d4e9717570
commit 1ac6912c7b
24 files changed
+242 -93

No files matched your search

+13
View File
@@ -4,6 +4,7 @@ import (
"context"
"os"
"path/filepath"
"runtime"
"testing"
"xianyu-go/internal/db"
@@ -91,3 +92,15 @@ func TestResolveDBPathPreservesCustomPath(t *testing.T) {
t.Fatalf("custom database path changed: got %q want %q", got, custom)
}
}
func TestPlaywrightRuntimeRootUsesProcessArchitecture(t *testing.T) {
opts := serverOptions{playwrightRuntimeRoot: filepath.Join(t.TempDir(), "playwright-runtime")}
applyPlaywrightRuntimeRoot(&opts)
wantRoot := filepath.Join(opts.playwrightRuntimeRoot, runtime.GOARCH)
if opts.playwrightDriverDir != filepath.Join(wantRoot, "playwright-driver") {
t.Fatalf("driver 目录=%q", opts.playwrightDriverDir)
}
if opts.playwrightBrowserDir != filepath.Join(wantRoot, "playwright-browsers") {
t.Fatalf("browser 目录=%q", opts.playwrightBrowserDir)
}
}