fix: 按系统规范解析桌面服务数据目录

macOS 和 Windows 在未显式指定工作目录时,通过 Go 的用户配置目录接口解析 YdisksXianyuHelper 数据目录;macOS LaunchAgent 不再注入数据库、密钥和浏览器目录参数。

服务自动创建数据目录及 data 子目录,将默认 SQLite 数据库放置到系统用户数据目录,修复 macOS 服务因 data/xianyu_data.db 父目录不存在而启动即退出的问题。

保留显式工作目录、Windows 现有 ProgramData 数据布局以及 Linux/Docker 的默认相对路径行为,并补充服务目录解析和数据库路径测试。

删除名称为桌面端 CI 的 GitHub Actions Workflow,保留桌面安装包构建发布 Workflow。
This commit is contained in:
Christ committed 2026-08-12 00:19:14 +08:00
1 parent bfa72fd9b7
commit d4e9717570
5 files changed
+94 -98

No files matched your search

-86
View File
@@ -1,86 +0,0 @@
name: 桌面端 CI
on:
push:
branches:
- codex/desktop-packaging
workflow_dispatch:
permissions:
contents: read
concurrency:
group: desktop-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
name: Go 与前端检查
if: github.ref == 'refs/heads/codex/desktop-packaging'
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v6
- name: 配置 Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: 配置 Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: 构建嵌入式前端
run: npm ci --prefix frontend && npm run build --prefix frontend
- name: 运行 Go 测试
run: go test ./...
- name: 运行 go vet
run: go vet ./...
cross-build:
name: 核心二进制 ${{ matrix.goos }}/${{ matrix.goarch }}
if: github.ref == 'refs/heads/codex/desktop-packaging'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: windows
goarch: amd64
- goos: windows
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
steps:
- name: 检出代码
uses: actions/checkout@v6
- name: 配置 Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
- name: 编译 server 与浏览器安装器
shell: bash
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
mkdir -p dist
go build -trimpath -ldflags='-s -w' -o "dist/xianyu-server-${GOOS}-${GOARCH}" ./cmd/server
go build -trimpath -ldflags='-s -w' -o "dist/browser-install-${GOOS}-${GOARCH}" ./cmd/browser-install