Skip to content

Commit

Permalink
fix: npm login before npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Jun 1, 2024
1 parent 07df586 commit 4fbc72d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ if [[ "$YARN_MAJOR" -ge "3" ]]; then
else
echo "Warning: Did not detect compatible yarn version. This action officially supports Yarn v3 and newer. Falling back to using npm." >&2
export npm_config__auth="$YARN_NPM_AUTH_TOKEN"
echo "//registry.npmjs.org/:_authToken=${YARN_NPM_AUTH_TOKEN}" >> ~/.npmrc
PUBLISH_CMD="npm publish --tag $PUBLISH_NPM_TAG"
LOGIN_CMD="npm adduser"
PACK_CMD="npm pack --pack-destination=/tmp/"
if [[ -f 'yarn.lock' ]]; then
INSTALL_CMD="yarn install --frozen-lockfile"
Expand Down Expand Up @@ -52,5 +52,4 @@ if [[ -n "$1" ]]; then
fi

$INSTALL_CMD
$LOGIN_CMD
$PUBLISH_CMD

0 comments on commit 4fbc72d

Please sign in to comment.