diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b50c893..b47c0ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,7 +63,8 @@ jobs: - name: Publish to npm if: steps.meta.outputs.published == 'false' - run: npm publish dist/npm --access public --provenance + # 路径必须带 ./,否则 npm 会把 dist/npm 解析成 GitHub 仓库 github:dist/npm + run: npm publish ./dist/npm --access public --provenance - name: Create the GitHub release if: github.ref_type == 'tag' diff --git a/scripts/build-npm-package.mjs b/scripts/build-npm-package.mjs index d00a0df..3de05bd 100644 --- a/scripts/build-npm-package.mjs +++ b/scripts/build-npm-package.mjs @@ -11,7 +11,7 @@ * - LICENSE * * 用法:npm run build:mcp && node scripts/build-npm-package.mjs - * 发布:npm publish dist/npm --access public + * 发布:npm publish ./dist/npm --access public(必须带 ./,否则 npm 会把 dist/npm 当成 GitHub 仓库) */ import fs from 'node:fs';