Skip to content

build: adopt stream-sdk npm publish workflow with OIDC - #5

Merged
haofeng0705 merged 2 commits into
DingTalk-Real-AI:mainfrom
typefield:stream-sdk-release-workflow
Sep 21, 2026
Merged

haofeng0705 merged 2 commits into
DingTalk-Real-AI:mainfrom
typefield:stream-sdk-release-workflow

Conversation

@typefield

Copy link
Copy Markdown
Contributor

Summary

Adopts the official open-dingtalk/dingtalk-stream-sdk-nodejs release workflow and packaging:

  • Add package metadata to package.json (repository, homepage, bugs, files).
  • Add .github/workflows/publish.yml using npm Trusted Publishing (OIDC id-token: write) and dynamic distribution tags (beta vs latest).

Test plan

  • Verified npm pack --dry-run includes only intended package files.
  • Verified publish.yml matches open-dingtalk/dingtalk-stream-sdk-nodejs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@haofeng0705 haofeng0705 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

发布工作流结构正确,但 package.json 的 test 脚本重新加回了 Node 18 不支持的参数:

"node --test --test-force-exit --test-timeout=15000 --test-concurrency=1 ..."

导致 Node Test (18.x) CI 失败:node: bad option: --test-force-exit、node: bad option: --test-timeout=15000。

请保持当前 main 上的兼容写法(仅保留 --test-concurrency=1):

"node --test --test-concurrency=1 test/channel.test.js ... test/download-to-file.test.js"

另外两个小建议:

  1. 若启用 npm Trusted Publishing / provenance,发布命令建议加 --provenance。
  2. 为便于 npm Trusted Publisher 映射,可考虑给 build job 设置 environment: npm(可选)。

…nance

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@typefield

Copy link
Copy Markdown
Contributor Author

已更新:

  • 恢复 package.json 中与 Node 18 兼容的 test 脚本写法,移除 --test-force-exit 和 --test-timeout=15000,仅保留 --test-concurrency=1。
  • 在 .github/workflows/publish.yml 的 npm publish 命令中增加 --provenance 参数以支持 npm Trusted Publishing。
  • 新提交为 3c8dfa770eac379afeb8e9c19c4233ab17fbb07a,CI 全部测试(Node 18/20/22)均已 pass。

@haofeng0705 haofeng0705 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

复查通过:test 脚本保持 Node 18 兼容写法(仅 --test-concurrency=1),发布命令已加 --provenance 支持 npm Trusted Publishing;Node 18/20/22 CI 全绿,可合入。

@haofeng0705
haofeng0705 merged commit 08616b8 into DingTalk-Real-AI:main Sep 21, 2026
3 checks passed
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.

2 participants