-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure NPM_AUTH_TOKEN on the node setup step
- Loading branch information
Showing
1 changed file
with
8 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
- update-publish-workflow | ||
workflow_dispatch: {} | ||
jobs: | ||
release: | ||
|
@@ -20,9 +21,11 @@ jobs: | |
git config user.email "[email protected]" | ||
- name: Check whether it's the latest commit | ||
run: if [[ $(git ls-remote origin -h ${{ github.ref }} | cut -f1) != ${{ github.sha }} ]]; then exit 1; fi | ||
- name: Setup Node.js | ||
- name: Setup Node | ||
uses: actions/[email protected] | ||
with: | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
with: | ||
node-version: 20 | ||
registry-url: https://registry.npmjs.org | ||
- name: Install build dependencies | ||
|
@@ -44,7 +47,7 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_REPOSITORY: ${{ github.repository }} | ||
GITHUB_REF: ${{ github.ref }} | ||
- name: Setup NPM registry | ||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc | ||
# - name: Setup NPM registry | ||
# run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc | ||
- name: Release to NPM | ||
run: npm publish --access public | ||
run: npm publish --access public |