Skip to content

ci: add npm publish automation + OpenClaw smoke#24

Merged
telagod merged 1 commit into
mainfrom
ci/release-automation
May 15, 2026
Merged

ci: add npm publish automation + OpenClaw smoke#24
telagod merged 1 commit into
mainfrom
ci/release-automation

Conversation

@telagod
Copy link
Copy Markdown
Owner

@telagod telagod commented May 15, 2026

Summary

两项 CI 自动化:

1. release.yml — npm 自动发布

订阅 release: published 事件。以后小宝在 GitHub 上 gh release create v2.1.x 之后,workflow 自动跑测试 + skills 契约 + npm publish --provenance,不再需要本地手动 publish。

安全 gate

  • tag == package.json.version:tag v2.1.x 必须对应 package.json 2.1.x,否则 abort(防止 git tag 和 package 漂移)
  • 跑完 npm test + npm run verify:skills 才 publish
  • --provenance:在 npmjs.com 公开记录 publish 来源(GitHub Actions run),有官方 attestation
  • id-token: write OIDC 权限(provenance 必需)
  • NPM_TOKEN 走 repository secret,不落地

2. ci.yml — 补 OpenClaw smoke

仓库自 v2.1.8 起支持 openclaw target,但 CI smoke 矩阵一直只覆盖 claude/codex/gemini。这次补齐 smoke-openclaw job,结构与 gemini 对齐:

  • Ubuntu / macOS / Windows 三平台
  • 断言:~/.openclaw/skills/workspace/AGENTS.mdworkspace/SOUL.md.sage-uninstall.js
  • 反向断言:commands/ 不存在、skills/gstack 不存在
  • 卸载后 .sage-backup 清空

Validation

本地预跑 OpenClaw 安装确认 smoke 断言全部对得上:

~/.openclaw/skills/run_skill.js
~/.openclaw/workspace/SOUL.md
~/.openclaw/workspace/AGENTS.md
~/.openclaw/.sage-uninstall.js

Migration

  • 当前 v2.1.11 release 不受影响:自动化只对未来 release 生效,v2.1.11 仍需手动 publish 一次(已经 publish 过的话就跳过)
  • 从 v2.1.12 起:本地 bump version + commit + tag → 推 → gh release create → workflow 自动 publish

Diff

 .github/workflows/ci.yml      | 42 +++++++++++++++++++++++++++++++++++
 .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 92 insertions(+)

Two CI changes:

1. release.yml — subscribe to 'release: published' events:
   - Re-runs npm test + npm run verify:skills before publish
   - Gates publish on tag == package.json version (prevents drift between
     'git tag v2.1.x' and an out-of-sync package.json)
   - Uses npm provenance (requires id-token: write OIDC permission)
   - Reads NPM_TOKEN from repository secret

   Future flow: 'gh release create v2.1.x' triggers automatic npm publish.

2. ci.yml — add smoke-openclaw matrix job:
   - Mirrors smoke-claude / smoke-codex / smoke-gemini structure
   - Covers ubuntu / macos / windows installer paths
   - Asserts: ~/.openclaw/skills, workspace/{AGENTS,SOUL}.md, .sage-uninstall.js
   - Smoke matrix was missing openclaw target since v2.1.8

Verified locally against pristine $HOME: install creates expected paths,
uninstall removes them.
@telagod telagod merged commit 1e2b526 into main May 15, 2026
15 checks passed
@telagod telagod deleted the ci/release-automation branch May 15, 2026 19:17
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