Skip to content

Commit 6310f5a

Browse files
committed
[chore] Add npm authentication check to release script
1 parent 1c80722 commit 6310f5a

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

scripts/release.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,27 @@ fi
9191

9292
info "Starting the release process"
9393

94+
# Step 0: Check npm authentication
95+
if [ -z "$RELEASE_DRY_RUN" ]; then
96+
retry_step "Check npm authentication" "
97+
if npm whoami > /dev/null 2>&1; then
98+
echo \"✓ npm authentication verified\"
99+
else
100+
echo \"✗ You appear to not be logged in to npm\"
101+
echo \"Please run 'npm login' (in a new terminal) to authenticate with npm\"
102+
echo \"Press Enter after logging in, or 'q' to quit\"
103+
read -r response
104+
if [ \"\$response\" = \"q\" ] || [ \"\$response\" = \"Q\" ]; then
105+
echo \"Release aborted by user\"
106+
exit 1
107+
fi
108+
npm whoami > /dev/null 2>&1
109+
fi
110+
"
111+
else
112+
info "dry mode -- skipping npm authentication check"
113+
fi
114+
94115
# Step 1: Install
95116
retry_step "make install" "make install"
96117

@@ -204,7 +225,7 @@ fi
204225

205226
# Step 10: Publish packages
206227
if [ -z "$RELEASE_DRY_RUN" ]; then
207-
retry_step "Publish packages" "./node_modules/.bin/lerna publish --no-verify-access from-package"
228+
retry_step "Publish packages" "./node_modules/.bin/lerna publish from-package"
208229
else
209230
info "dry mode -- skipping lerna publish"
210231
fi

0 commit comments

Comments
 (0)