Files
sundynix-agentix/Makefile
T
Blizzard a5cf2c5f36 ci: 构建链补完 wails v2→v3 迁移,CI 触发收敛到 main
代码早就全量迁到 v3(go.mod 只要 wails/v3、main.go import v3/pkg/application),
但"怎么构建"这一层从没跟上,全还是 v2:

- release.yml 装 v2 CLI(wails@v2.12.0)去编 v3 代码,编不过;产物路径也还
  指向 v2 的 build/bin/,而 v3 落在 bin/。这条只在打 v* tag 时触发,迁移后
  一次都没跑过,所以坏了半个月没人知道 —— 下次发版必炸。
- Makefile 的 wails dev/build 直接 command not found。
- README 叫人装 v2 CLI;RELEASE.md 还在提早已删除的 wails.json。

改动:
- ci.yml 触发从 [main, dev] 收到 [main]。dev 分支已删,开发在 feat/wails3,
  留着 dev 是死条件;PR 以 main 为目标仍会跑,合入前有关卡。
- release.yml 全量转 v3:
  * CLI 钉死 v3.0.0-alpha2.117,与 go.mod 的 wails/v3 版本一致 —— alpha 阶段
    CLI 生成的 bindings 和运行时配套,版本错开会出难查的怪问题。
  * mac 走 wails3 task darwin:package:universal。v3 的 build 只出裸二进制
    (macOS 上双击不起窗),必须 package 才有 .app;本地实跑验证过,
    lipo -archs 确认是真 universal(x86_64 + arm64)。
  * Windows 保持 v2 时代行为发裸 .exe。v3 的 package 默认走 NSIS 出 installer,
    依赖 runner 上有 makensis,属额外未知数,要升级安装包再单独议。
  * 产物路径 build/bin/ → bin/。
  * fail_on_unmatched_files 改 true,并按 matrix 只匹配自己那个产物 ——
    原来是 false 且两个平台都列全量文件,产物路径写错会安静发一个没附件的
    Release。这次的 bug 正是路径漂移,得让它当场炸。
- RELEASE.md 版本号对齐表补上第三处 build/config.yml 的 info.version(此前写着
  "必须三处对齐"却只列了两处,第三处是已删的 wails.json),并记下改完必须跑
  wails3 task common:update:build-assets 重新生成 Info.plist —— 这坑踩过。
- 清掉 v2 残留:frontend/wailsjs/(v2 绑定,v3 用已跟踪的 bindings/)及其
  gitignore 规则、build/bin/ 里 v2 时代的 .app。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-16 15:03:32 +08:00

67 lines
2.8 KiB
Makefile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
.PHONY: infra infra-down devnats demo e2e test test-go test-web test-py gateway dispatcher mcp-go mcp-py mcp-py-setup web admin desktop desktop-build tidy
infra: ## 启动基础设施 (NATS / Postgres / Redis / Milvus / Neo4j)
docker compose up -d
infra-down:
docker compose down
devnats: ## 启动内嵌 JetStream NATS(无 Docker 本地联调)
cd sundynix-shared && go run ./cmd/devnats
demo: ## 一键演示 Gateway→NATS→Dispatcher 任务流(无需 Docker
bash scripts/demo.sh
e2e: ## 跑共享 bus 的端到端测试(内嵌 NATS):任务流 / 工具调用 / Token 流
cd sundynix-shared && go test ./bus/ -run 'TestTaskRoundTrip|TestToolCallRoundTrip|TestTokenStreamRoundTrip' -v
test: test-go test-web ## 跑全部测试(后端各模块 go test + 前端类型检查)
test-go: ## 各 Go 模块单测(DB 集成测试无 MEMORY_TEST_DSN 自动跳过)
cd sundynix-shared && go test ./...
cd sundynix-gateway && go test ./...
cd sundynix-dispatcher && go test ./...
cd sundynix-mcp-go && go test ./...
test-web: ## 前端 TypeScript 类型检查
cd sundynix-desktop/frontend && npx tsc --noEmit
test-py: ## mcp-py 沙箱守卫测试(需 venv;缺 pytest 用内置 harness 兜底)
cd sundynix-mcp-py && ( PYTHONPATH=src:tests .venv/bin/python -m pytest tests/ -q 2>/dev/null \
|| PYTHONPATH=src:tests .venv/bin/python -c "import test_sandbox as t; \
fns=[getattr(t,n) for n in dir(t) if n.startswith('test_')]; \
[ (f(),print('PASS',f.__name__)) for f in fns ]; print(f'{len(fns)} passed')" )
gateway:
cd sundynix-gateway && go run ./cmd/server
dispatcher:
cd sundynix-dispatcher && go run ./cmd/dispatcher
mcp-go:
cd sundynix-mcp-go && go run ./cmd/server
mcp-py-setup: ## 创建 venv 并安装 mcp-py 依赖(首次运行 mcp-py 前执行)
cd sundynix-mcp-py && python3 -m venv .venv && .venv/bin/pip install -q -e .
mcp-py: ## 运行 Python 算法型 MCP 工具服务(缺 venv 则自动 setup
cd sundynix-mcp-py && [ -x .venv/bin/python ] || $(MAKE) mcp-py-setup
cd sundynix-mcp-py && .venv/bin/python -m sundynix_mcp_py.main
web: ## 桌面端前端 devVite :5173,连本地 Gateway:8080
cd sundynix-desktop/frontend && npm install && npm run dev
admin: ## 运维控制台 devVite :5174,配置 LLM 模型等控制面)
cd sundynix-admin && npm install && npm run dev
desktop: ## 真实桌面端开发模式(Wails 原生窗口 + 热重载;需先 make infra + 后端 + 配模型)
cd sundynix-desktop && GOWORK=off wails3 dev
desktop-build: ## 打包桌面端为原生 .app(产物在 sundynix-desktop/bin/
cd sundynix-desktop && GOWORK=off wails3 package
tidy:
cd sundynix-gateway && go mod tidy
cd sundynix-dispatcher && go mod tidy
cd sundynix-mcp-go && go mod tidy