Merge branch 'lerna_ci_take_five' into 'development'
Simplify Lerna See merge request GeneralProtocols/xo/stack!32
This commit is contained in:
+8
-9
@@ -40,22 +40,21 @@ publish:development:
|
|||||||
- git config --global user.name "${GITLAB_USER_NAME}"
|
- git config --global user.name "${GITLAB_USER_NAME}"
|
||||||
|
|
||||||
# Configure git to push with CI token
|
# Configure git to push with CI token
|
||||||
- git remote set-url origin "https://oauth2:${CI_JOB_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git"
|
- git remote set-url origin "https://gitlab-ci-token:$GL_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git"
|
||||||
|
|
||||||
# Checkout the branch instead of detached HEAD
|
# Checkout the development branch so that we're not on a detached HEAD (which GitLab CI will default to).
|
||||||
# NOTE: GitLab CI will use a detached HEAD
|
- git checkout development
|
||||||
- git checkout -B ${CI_COMMIT_REF_NAME}
|
|
||||||
- git pull origin ${CI_COMMIT_REF_NAME}
|
|
||||||
|
|
||||||
# Setup npm config for npmjs.com
|
# Setup npm config for npmjs.com
|
||||||
- npm config set registry https://registry.npmjs.org/
|
- npm config set registry https://registry.npmjs.org/
|
||||||
- npm config set //registry.npmjs.org/:_authToken ${NPM_AUTH_TOKEN}
|
- npm config set //registry.npmjs.org/:_authToken ${NPM_AUTH_TOKEN}
|
||||||
|
|
||||||
# Version and publish
|
# Version and publish
|
||||||
- npx lerna version patch --yes --force-publish
|
- npx lerna publish --yes --canary --preid ${NPM_TAG} --dist-tag ${NPM_TAG}
|
||||||
- npx lerna publish from-git --yes --registry https://registry.npmjs.org/
|
rules:
|
||||||
only:
|
# Only run on development branch and when actioning merge requests.
|
||||||
- development
|
# NOTE: If we don't run on only merge requests, we end up with an infinite looping due to Lerna updating the branch with its version commits.
|
||||||
|
- if: $CI_COMMIT_BRANCH == "development" && $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||||
|
|
||||||
# Publish the documentation to GitLab Pages (for now).
|
# Publish the documentation to GitLab Pages (for now).
|
||||||
pages:
|
pages:
|
||||||
|
|||||||
Reference in New Issue
Block a user