mirror of
https://gitcode.com/JianFeeeee/homeagent-sdk.git
synced 2026-09-30 06:13:14 +00:00
与主仓 Release 流水线同构,差异只在产物与打包命令:
prepare 读 meta.Version;tag 已存在则整轮跳过;go test 门可显式跳过
(改 meta 的提交里写 [skip-release-tests],查该提交而非 HEAD)
build go build(硬门)→ go test → build.sh all hmapdev → 验证 5 平台齐全
→ 生成 SHA256SUMS → artifact
publish 打 tag → gh release create 传附件 → 回读校验
sync-gitcode 有 GITCODE_TOKEN 时同步(无则跳过)
产物清单不是猜的,依 gitcode 上 v1.2.0/v1.3.0 的实际附件(各 6 个):
hmapdev_{linux,darwin}_{amd64,arm64} + hmapdev_windows_amd64.exe + SHA256SUMS
两个易错点都有实测依据:
1. **测试要分两处跑**:tools/hmapdev 是**独立 module**,根模块的
`go test ./...` 不会进入它(Go 的模块边界,不是配置问题)。
2. **gitcode 上传必须显式列文件名**:上传脚本的路径语义是
`os.path.join(ASSET_DIR, name)`,所以要 cd 进目录 + `ASSET_DIR=.` + 裸名;
而它按扩展名识别产物的默认扫描对 hmapdev **无效** —— 五个产物里只有
windows 那个有扩展名,自动扫描会静默地一个都不传。
故把主仓的 upload_assets.py 一并纳入本仓 scripts/(两仓各自独立可取)。
本地已验证:`VERSION=1.4.0 bash package/build.sh all hmapdev` 产出 5 个
二进制(各 27–29M),根模块 go test 通过,actionlint 全绿。