Skip to content

Commit b5c59d6

Browse files
author
Marvin Zhang
committed
chore: Update package.json and GitHub Actions workflow for pnpm integration
- Changed the "prepare" script in package.json to use pnpm instead of npm. - Added npm configuration step in the GitHub Actions workflow to handle authentication for publishing. - Simplified the publish step by removing redundant npmrc configuration commands.
1 parent 53350bc commit b5c59d6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
with:
2323
version: latest
2424

25+
- name: Configure npm
26+
run: |
27+
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
28+
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
2532
- name: Install dependencies
2633
run: pnpm install --frozen-lockfile
2734

@@ -32,8 +39,6 @@ jobs:
3239
run: pnpm build
3340

3441
- name: Publish to NPM
35-
run: |
36-
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
37-
pnpm publish --access public --no-git-checks
42+
run: pnpm publish --access public --no-git-checks
3843
env:
3944
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"build": "tsc",
66
"dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
77
"test": "jest",
8-
"prepare": "npm run build"
8+
"prepare": "pnpm run build"
99
},
1010
"devDependencies": {
1111
"@types/jest": "^29.5.14",

0 commit comments

Comments
 (0)