Skip to content

Prepare trusted ClawHub publishing - #59

Merged
NewFuture merged 3 commits into
mainfrom
newfuture-prepare-clawhub-publish
Aug 10, 2026
Merged

NewFuture merged 3 commits into
mainfrom
newfuture-prepare-clawhub-publish

Conversation

@NewFuture

Copy link
Copy Markdown
Owner

Summary

  • add ClawHub compatibility and presentation metadata while preserving the canonical openclaw-weixin npm package, plugin ID, channel ID, and state identity
  • build an openclaw-wechat ClawPack only from the canonical npm tarball, retaining the npm fallback and source provenance
  • add credential-free PR validation/dry-runs and release-tag-only OIDC publishing through a protected clawhub-publish environment
  • document first-publication bootstrap, trusted-publisher setup, recovery, and bilingual Unreleased notes

Validation

  • npm run check
  • npm run pack:check
  • focused ClawPack, workflow, GitHub package, and compatibility tests
  • exact OpenClaw 2026.6.1 and 2026.7.1 typecheck, build, fresh-process SDK boundary, and plugin/channel registration smoke checks
  • ClawHub CLI 0.23.3 validation: pass with zero breakages and warnings
  • ClawHub publish dry-run: openclaw-wechat@3.1.0, code-plugin, 92 files
  • documentation-site tests and production build

Maintainer setup

Before binding the trusted publisher, create and protect the clawhub-publish GitHub environment with administrator approval and deployment limited to v* tags. The first ClawHub publication must be performed manually from the next formal release tag containing this change; existing tags, including v3.1.0, must not be reused. After that bootstrap publication, bind openclaw-wechat to clawhub-publish.yml and the clawhub-publish environment. No long-lived CLAWHUB_TOKEN is required.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 10, 2026 04:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Prepares a trusted ClawHub publishing path while preserving the canonical npm, plugin, channel, and state identities.

Changes:

  • Adds ClawHub metadata and canonical-package validation.
  • Builds and tests openclaw-wechat ClawPacks from npm tarballs.
  • Adds protected OIDC publishing and bilingual release documentation.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/clawhub-publish.yml Adds dry-run and protected publishing jobs.
CHANGELOG.md Documents the change in Chinese.
CHANGELOG_EN.md Documents the change in English.
CONTRIBUTING.md Adds ClawPack validation instructions.
RELEASE.md Documents bootstrap, publishing, and recovery.
docs/site/.vitepress/docs.mjs Updates release-guide metadata.
index.ts Aligns runtime presentation metadata.
openclaw.plugin.json Adds ClawHub display metadata.
package.json Adds compatibility and build metadata.
scripts/check-package.mjs Strengthens package identity checks.
scripts/clawhub-workflow.test.mjs Tests workflow security constraints.
scripts/package-variant.mjs Implements validated package variants.
scripts/prepare-clawhub-package.mjs Builds the ClawHub package variant.
scripts/prepare-clawhub-package.test.mjs Tests ClawPack conversion and identity.
scripts/prepare-github-package.mjs Reuses canonical manifest helpers.
src/compat.test.ts Tests compatibility and display metadata.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/prepare-clawhub-package.mjs Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

Suppressed comments (2)

scripts/prepare-clawhub-package.test.mjs:119

  • This exercises extraction only with an npm-generated safe archive, so the new empty-archive and unsafe-path rejection boundary is untested. Add crafted archives containing absolute and traversal entries, assert rejection, and verify no file is written outside the extraction root.
  mkdirSync(join(packageDirectory, "dist"));

scripts/prepare-clawhub-package.test.mjs:111

  • The successful test only passes the tarball path, while the production workflow passes the containing directory. This leaves the directory-resolution branch—including the exactly-one-archive invariant—uncovered. Add a success case for a directory with one .tgz and rejection cases for zero and multiple archives.
    additionalProperties: false,

Copilot AI review requested due to automatic review settings August 10, 2026 04:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Comment thread scripts/prepare-clawhub-package.mjs Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 10, 2026 04:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated no new comments.

@ericcaiwx-star

Copy link
Copy Markdown
Collaborator

协作备注(审阅视角,非合并)

先看了已发的 v3.1.0:SDK channel-message 兼容、context-token 用户 ID 小写规范化、以及 #53 的 alias→hash 逻辑映射都进正式版了,谢谢。

再看本 PR(ClawHub trusted publishing)整体方向我认可,几处关键设计也踩对了:

认同的点

  1. 身份分层清楚:ClawHub listing 用 openclaw-wechat,canonical npm / plugin / channel id 仍固定 openclaw-weixin——避免改状态路径、bindings、已有安装面,和多账号现场兼容。
  2. 产物只从 npm tarball 派生:不另开一套源码打包路径,provenance 更干净;converter 只改临时包名与 installer choice,不碰源 tarball。
  3. 发布闸门:PR 上无凭证 dry-run;真正 publish 仅 workflow_dispatch + 匹配 v* tag + protected clawhub-publish + OIDC(id-token: write),不引入长期 CLAWHUB_TOKEN
  4. 首次发布纪律:明确不复用已有 tag(含 v3.1.0),先手工 bootstrap 再绑 trusted publisher——和 npm OIDC 同类约束,文档写得很清楚。
  5. 打包安全:Copilot 提的 path traversal / symlink / 非 file|dir entry,后续 commit 已用 tar 解析拒绝并补回归,这点对「可信发布」很关键。

CI(含 ClawHub dry-run、双宿主矩阵)目前也是绿的。

小建议(非 blocker)

  • RELEASE/CONTRIBUTING 里已写「listing 尚需 bootstrap」——合并后若 README 安装区只提 npm,建议加一句「ClawHub 为并行分发面,插件 ID 仍是 openclaw-weixin」,减少有人以为要改 channels.openclaw-weixin / 重装账号的误读。
  • bootstrap 完成后,#36 或 RELEASE 勾一下「ClawHub openclaw-wechat 已公开 + trusted publisher 已绑」,方便跟发行面的人对照。

我这边没有看到会破坏现有 openclaw-weixin 运行时合同的改动;支持合入后按文档做下一次正式 tag 的首次 ClawHub 发布。

@NewFuture
NewFuture merged commit d8ef11d into main Aug 10, 2026
16 checks passed
@NewFuture
NewFuture deleted the newfuture-prepare-clawhub-publish branch August 10, 2026 13:18
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.

3 participants