fix(ci): write NPM_TOKEN to ~/.npmrc in publish.sh for CI authentication
Some checks failed
Stuffle/iam-client-sdk/pipeline/pr-main There was a failure building this commit

This commit is contained in:
2026-05-04 00:45:19 +05:30
parent 47926656d7
commit 6c0561f693

View File

@@ -3,6 +3,14 @@
semver=${1:-patch}
set -e
# In CI, NPM_TOKEN is injected as an env var (Jenkins secret / GitHub Actions secret).
# Write it to ~/.npmrc so npm publish can authenticate without interactive login.
# For local publishing, this block is skipped and your existing `npm login` session is used.
if [ -n "$NPM_TOKEN" ]; then
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
fi
npm run build
npm --no-git-tag-version version ${semver}
npm publish --access public