Use NPM registry

This commit is contained in:
Jim Hamill
2025-02-16 05:06:53 +00:00
parent 977f42e30a
commit 6390de9d9b
2 changed files with 8 additions and 10 deletions
+7 -9
View File
@@ -33,7 +33,7 @@ publish:development:
variables:
NPM_TAG: 'development'
GITLAB_USER_EMAIL: 'ci@stack.xo.cash'
GITLAB_USER_NAME: 'CI - Stack'
GITLAB_USER_NAME: 'GitLab CI'
script:
# Setup git config
- git config --global user.email "${GITLAB_USER_EMAIL}"
@@ -42,15 +42,13 @@ publish:development:
# Configure git to push with CI token
- git remote set-url origin "https://oauth2:${CI_JOB_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git"
# Setup npm authentication
- |
echo "@${CI_PROJECT_ROOT_NAMESPACE}:registry=https://gitlab.com/api/v4/packages/npm/" > .npmrc
echo "//gitlab.com/api/v4/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
echo "//gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
# Setup npm config for npmjs.com
- npm config set registry https://registry.npmjs.org/
- npm config set //registry.npmjs.org/:_authToken ${NPM_AUTH_TOKEN}
# Skip git checks when versioning and publishing
- npx lerna version patch --yes --force-publish --no-git-reset
- npx lerna publish from-git --yes --no-git-reset
# Version and publish
- npx lerna version patch --yes --force-publish
- npx lerna publish from-git --yes --registry https://registry.npmjs.org/
only:
- development