From 1799c3a1b239744b8a1a9c46c6e5fd761dfc27f0 Mon Sep 17 00:00:00 2001 From: lazyalex616 Date: Mon, 2 Nov 2026 15:16:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=91=E7=89=88=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E7=9A=84=20npm=20publish=20=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=8A=A0=20./=EF=BC=8C=E9=81=BF=E5=85=8D=E8=A2=AB=E5=BD=93?= =?UTF-8?q?=E6=88=90=20GitHub=20=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 3 ++- scripts/build-npm-package.mjs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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';