Skip to content

Commit

Permalink
Merge pull request #1 from seepine/patch-1
Browse files Browse the repository at this point in the history
ci(actions): fix auth of npm
  • Loading branch information
chenbimo authored Nov 28, 2024
2 parents 0822cce + 2b6ccda commit a44f7a8
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,28 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- uses: pnpm/action-setup@v4

- name: Setup Pnpm
uses: pnpm/action-setup@v4
with:
version: latest
run_install: true
- run: pnpm run r
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

- name: Authenticate with Registry
run: |
echo "link-workspace-packages=true" > ./.npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.npm_token }}" >> ./.npmrc
npm whoami
- name: Publish to npm
run: pnpm run r

0 comments on commit a44f7a8

Please sign in to comment.