Skip to content

Commit 05376ea

Browse files
committed
ci: add npm auth in publish workflow and set publishConfig.access for unplugin
1 parent 156a94a commit 05376ea

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/nodejs-publish.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,17 @@ jobs:
3434
env:
3535
HUSKY: 0
3636

37+
- name: Authenticate to npm
38+
run: |
39+
printf "//registry.npmjs.org/:_authToken=${NPM_TOKEN}\n" >> ~/.npmrc
40+
env:
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
3743
- name: Build
3844
run: pnpm -w build
3945

4046
- name: Publish with Changesets
4147
run: pnpm release
4248
env:
4349
NPM_CONFIG_PROVENANCE: true
50+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

packages/unplugin/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
"url": "https://github.com/user/react-code-view.git",
8989
"directory": "packages/unplugin"
9090
},
91+
"publishConfig": {
92+
"access": "public"
93+
},
9194
"scripts": {
9295
"build": "tsup",
9396
"dev": "tsup --watch",

0 commit comments

Comments
 (0)