File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 gh release create "${{ github.ref_name }}" dist/*.mcpb \
4040 --title "${{ github.ref_name }}" \
4141 --generate-notes
42+
43+ npm-publish :
44+ runs-on : ubuntu-latest
45+ needs : release
46+ steps :
47+ - uses : actions/checkout@v6
48+ - uses : actions/setup-node@v6
49+ with :
50+ node-version : " 24"
51+ registry-url : " https://registry.npmjs.org"
52+ - run : npm ci
53+ working-directory : mcp-server
54+ - name : Sync version from git tag
55+ working-directory : mcp-server
56+ run : npm version "${GITHUB_REF_NAME#v}" --no-git-tag-version
57+ - name : Publish to npm
58+ working-directory : mcp-server
59+ env :
60+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
61+ run : |
62+ TAG="latest"
63+ if echo "${GITHUB_REF_NAME}" | grep -qE '[-]'; then
64+ TAG="next"
65+ fi
66+ npm publish --access public --tag "$TAG"
Original file line number Diff line number Diff line change @@ -197,13 +197,15 @@ Node.js >= 18.0.0 が必要。
197197| ---------| --------| ------|
198198| ` v* ` タグ push | build-mcpb | ` mcpb pack ` で .mcpb 生成 |
199199| ` v* ` タグ push | release | GitHub Release 作成 + .mcpb 添付 |
200+ | ` v* ` タグ push | npm-publish | npm レジストリに公開 |
200201
201202リリースフロー:
202- 1 . ` npm version patch/minor/major ` で package.json 更新 + ` v* ` タグ作成
203- 2 . ` git push origin main --tags ` でタグ push
204- 3 . CD が自動実行: .mcpb 生成 → release 作成 → .mcpb 添付
203+ 1 . ` v* ` タグを push する
204+ 2 . CD が自動実行: .mcpb 生成 → release 作成 → .mcpb 添付 → npm publish
205+ 3 . npm publish 時にタグ名から自動でバージョンを同期する(package.json の手動更新不要)
206+ 4 . プレリリースタグ(` - ` を含む)は ` next ` dist-tag で公開、正式リリースは ` latest ` で公開
205207
206- バージョン管理は npm (package.json) が正。 manifest.json のバージョンも一致させる。
208+ manifest.json のバージョンも一致させる。
207209
208210## Infrastructure
209211
You can’t perform that action at this time.
0 commit comments