Skip to content

Commit 987988a

Browse files
committed
ci: fix ci
1 parent e3730c7 commit 987988a

1 file changed

Lines changed: 8 additions & 11 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout Repo
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222

2323
- name: Setup Node.js 20.x
24-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v4
2525
with:
2626
node-version: 20.x
2727
registry-url: 'https://registry.npmjs.org'
28-
env:
29-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3028

3129
- name: Setup pnpm
3230
uses: pnpm/action-setup@v4
@@ -37,15 +35,15 @@ jobs:
3735
- name: Build
3836
run: pnpm build
3937

40-
- name: Configure npm authentication for pnpm
38+
- name: Configure npm authentication for pnpm (OIDC)
4139
run: |
42-
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
43-
echo "@arkts:registry=https://registry.npmjs.org/" >> ~/.npmrc
44-
chmod 600 ~/.npmrc
40+
# setup-node 已经创建了 ~/.npmrc,pnpm 需要能够读取它
41+
# 确保 @arkts scope 使用正确的 registry
42+
if [ -f ~/.npmrc ]; then
43+
echo "@arkts:registry=https://registry.npmjs.org/" >> ~/.npmrc
44+
fi
4545
echo "Verifying npm authentication..."
4646
npm whoami --registry=https://registry.npmjs.org/ || echo "Warning: npm whoami failed"
47-
env:
48-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4947
5048
- name: Create Release Pull Request or Publish to npm
5149
id: changesets
@@ -55,4 +53,3 @@ jobs:
5553
publish: pnpm changeset publish
5654
env:
5755
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)