Skip to content

Commit

Permalink
ci: create a .npmrc file in the $HOME directory when running the rele…
Browse files Browse the repository at this point in the history
…ase job
  • Loading branch information
luohuidong committed Jun 26, 2024
1 parent 4bd7bc0 commit 0d27c01
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ jobs:
node-version: 20
registry-url: "https://registry.npmjs.org"

- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
Expand All @@ -56,4 +64,3 @@ jobs:
publish: pnpm -r publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
auto-install-peers=true

0 comments on commit 0d27c01

Please sign in to comment.