Commit 3c787180 authored by mohoff's avatar mohoff

feat: split release job into automatic (for libraries) and manual releases

parent 0124c308
Pipeline #23302 passed with stages
in 20 seconds
release_manual:
extends: .release
when: manual
release:
stage: release
variables:
GIT_USER_NAME: "gitlab-bot"
GIT_USER_EMAIL: "gitlab-bot@brickblock.io"
GIT_HOST: "git.brickblock.sh"
REPOSITORY_PATH: "${CI_PROJECT_PATH}"
extends:
- .except-ci-release
- .cache-pull-only
only:
- master
artifacts:
paths:
- CHANGELOG.md
dependencies:
- build_npm_package
release_automatically:
extends: .release
script:
- git config --global user.name ${GIT_USER_NAME}
- git config --global user.email ${GIT_USER_EMAIL}
- git config --global push.default current
- yarn release
- echo '//registry.npmjs.org/:_authToken=${SECRET_NPM_TOKEN}'>.npmrc
- git push https://${GIT_USER_NAME}:${SECRET_GITLAB_BOT_CI_TOKEN}@${GIT_HOST}/${REPOSITORY_PATH} HEAD:master --follow-tags
- echo '//registry.npmjs.org/:_authToken=${SECRET_NPM_TOKEN}' > .npmrc
- npm publish --access public
- npx @brickblock/slack-changelog-notifier --projectName $CI_PROJECT_NAME
......@@ -66,3 +66,29 @@ variables:
allow_failure: true
# ${DEPLOYMENT} and ${NAME} must be set in the extending job
script: kubectl rollout restart deployment ${DEPLOYMENT} -n ${NAMESPACE}
.release:
stage: release
variables:
GIT_USER_NAME: "gitlab-bot"
GIT_USER_EMAIL: "gitlab-bot@brickblock.io"
GIT_HOST: "git.brickblock.sh"
REPOSITORY_PATH: "${CI_PROJECT_PATH}"
extends:
- .except-ci-release
- .cache-pull-only
only:
- master
artifacts:
paths:
- CHANGELOG.md
dependencies:
- build_npm_package
before_script:
- git config --global user.name ${GIT_USER_NAME}
- git config --global user.email ${GIT_USER_EMAIL}
- git config --global push.default current
- yarn release
- git push https://${GIT_USER_NAME}:${SECRET_GITLAB_BOT_CI_TOKEN}@${GIT_HOST}/${REPOSITORY_PATH} HEAD:master --follow-tags
after_script:
- npx @brickblock/slack-changelog-notifier --projectName $CI_PROJECT_NAME
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment