Skip to content

Commit 42a1568

Browse files
committed
ci: 对npm发布失败ci重新编写
1 parent 0a108b8 commit 42a1568

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/build-and-publish.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
with:
2828
node-version: 22
2929
cache: pnpm
30-
registry-url: 'https://registry.npmjs.org'
3130

3231
- name: Install dependencies
3332
run: pnpm install
@@ -68,9 +67,12 @@ jobs:
6867
6968
- name: Publish to npm
7069
if: env.ALREADY_PUBLISHED == 'false'
71-
run: pnpm publish --access public
7270
env:
7371
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
72+
run: |
73+
npm config set //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}
74+
npm config set registry=https://registry.npmjs.org/
75+
npm publish --access public
7476
7577
- name: Create GitHub Release
7678
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)