Use NPM registry
This commit is contained in:
+7
-9
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user