ci: make release run only on main branch and dry run on other branches
This commit is contained in:
parent
2c9a7cc7e4
commit
25b97e5beb
1 changed files with 14 additions and 0 deletions
|
|
@ -31,6 +31,13 @@ release:tag--dry-run:
|
|||
echo "!!! THIS IS A DRY RUN !!!"
|
||||
echo "NO RELEASE WILL BE CREATED"
|
||||
- semantic-release --dry-run -b ${CI_COMMIT_REF_NAME}
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: never
|
||||
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
||||
when: never
|
||||
- if: $CI_COMMIT_MSG =~ /^chore\(CHANGELOG\):/
|
||||
when: never
|
||||
|
||||
release:tag:
|
||||
stage: pre-release
|
||||
|
|
@ -40,6 +47,13 @@ release:tag:
|
|||
- npm i -g semantic-release @semantic-release/git @semantic-release/changelog @semantic-release/gitlab
|
||||
script:
|
||||
- semantic-release -b ${CI_COMMIT_REF_NAME}
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG
|
||||
when: never
|
||||
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
|
||||
when: always
|
||||
- if: $CI_COMMIT_MSG =~ /^chore\(CHANGELOG\):/
|
||||
when: never
|
||||
|
||||
release:publish:
|
||||
stage: release
|
||||
|
|
|
|||
Reference in a new issue