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
Some checks failed
Stuffle/iam-client-sdk/pipeline/pr-main There was a failure building this commit
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user