Skip to content

feat: add Windows support + multi-platform GitHub Actions release#25

Open
lk19940215 wants to merge 3 commits into
vibe-coding-labs:mainfrom
lk19940215:feat/windows-support
Open

feat: add Windows support + multi-platform GitHub Actions release#25
lk19940215 wants to merge 3 commits into
vibe-coding-labs:mainfrom
lk19940215:feat/windows-support

Conversation

@lk19940215

@lk19940215 lk19940215 commented Jun 29, 2026

Copy link
Copy Markdown

概要

新增 Windows 和 macOS Intel 跨平台支持,并添加 GitHub Actions CI/CD 流水线实现自动化多平台构建与发布。

变更内容

GitHub Actions 发布工作流 (.github/workflows/release.yml)

  • 三阶段流水线:构建前端 → 交叉编译二进制 → 创建 Release
  • 交叉编译目标:darwin-arm64、darwin-amd64、linux-amd64、windows-amd64
  • 触发方式:tag 推送(v*)或手动 workflow_dispatch
  • 自动生成 SHA256 校验文件和 GitHub Release(含下载表格)

Windows 进程管理 (process_unix.go, process_windows.go)

  • daemon.go 中的 Unix 特定系统调用(SetpgidSIGTERMSIGKILLSignal(0))提取到平台特定文件,使用 build tags 隔离
  • Windows 实现:CREATE_NEW_PROCESS_GROUPtaskkill /TOpenProcess

Windows 服务管理 (service_windows.go)

  • 基于 NSSM 实现 installServiceuninstallServiceserviceStatus
  • 支持开机自启、崩溃自动重启、日志输出

跨平台凭据检测 (credentials.go)

  • 扩展 LoadFromSystem() 支持 Windows(%APPDATA%)和 Linux(~/.config)路径
  • 修复 Windows 驱动器盘符的 SQLite URI 编码(C:\...file:/C:/...

Bug 修复 (main.go)

  • 命令失败时输出错误信息(原来因 SilenceErrors: true 导致静默退出)

已测试平台

平台 构建 验证方式
darwin-arm64 GitHub Actions
darwin-amd64 GitHub Actions + 本地运行验证
linux-amd64 GitHub Actions
windows-amd64 GitHub Actions

向后兼容性

  • 现有 macOS/Linux 行为零影响 — Unix 代码路径通过 process_unix.go 完整保留
  • daemon.go 调用相同函数签名,仅通过 build tags 分发
  • 未添加任何新依赖

测试计划

  • 四平台二进制文件均通过 GitHub Actions 构建成功
  • macOS Intel 二进制文件本地运行并正常提供服务
  • macOS 凭据自动检测正常
  • --helpservewhoami 命令验证通过

- Add GitHub Actions workflow (.github/workflows/release.yml) that builds
  binaries for darwin-arm64, darwin-amd64, linux-amd64, windows-amd64
- Add process_unix.go / process_windows.go for platform-specific process
  management (daemon detach, terminate, kill, liveness check)
- Add service_windows.go for Windows service management via NSSM
- Update daemon.go to use platform-abstracted helpers instead of direct
  Unix syscalls (Setpgid, SIGTERM, SIGKILL, Signal(0))
- Update credentials.go to support Windows/Linux JoyCode IDE state paths
  and fix SQLite URI encoding for Windows backslash paths

All 4 platforms verified with CGO_ENABLED=0 cross-compilation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@lk19940215

Copy link
Copy Markdown
Author

用 opus 4.6 thinkings ,支持 windows 、macos intel 。 AI 弄得,代码做了AI复审

longkuo and others added 2 commits June 29, 2026 17:38
- Fix SQLite URI for Windows drive letter paths (C:\... → /C:/...)
- Fix workflow_dispatch to checkout tag commit instead of HEAD
- Fix service_windows.go MkdirAll error handling
- Update service.go description to include Windows (NSSM)

Co-authored-by: Cursor <cursoragent@cursor.com>
rootCmd has SilenceErrors: true which suppresses cobra default error
output. The main function was calling os.Exit(1) without printing the
error, causing users to see silent failures on credential validation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant