ci: add tag only flow for releases
This commit is contained in:
@@ -190,4 +190,33 @@ release:
|
||||
when: never
|
||||
- if: $CI_DEFAULT_BRANCH != $CI_COMMIT_BRANCH
|
||||
when: never
|
||||
- if: $UNBOUND_RELEASE_TAG_ONLY == "true"
|
||||
when: never
|
||||
- if: '$CI_COMMIT_TITLE =~ /^chore\(release\): prepare for .*$/'
|
||||
|
||||
tag:
|
||||
stage: .pre
|
||||
image: alpine:latest
|
||||
needs:
|
||||
- prepare_release
|
||||
before_script:
|
||||
- 'apk add --no-cache curl'
|
||||
script:
|
||||
- |
|
||||
echo "Creating tag"
|
||||
NAME="$(cat VERSION)"
|
||||
MESSAGE="$(cat CHANGES.md)"
|
||||
curl -sf -X POST \
|
||||
-H "Authorization: Bearer ${UNBOUND_RELEASE_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/repository/tags?tag_name=${NAME}&ref=${CI_DEFAULT_BRANCH}&message=${NAME}"
|
||||
rules:
|
||||
- if: $UNBOUND_RELEASE_TOKEN == null
|
||||
when: never
|
||||
- if: $CI_DEFAULT_BRANCH != $CI_COMMIT_BRANCH
|
||||
when: never
|
||||
- if: $UNBOUND_RELEASE_TAG_ONLY == null
|
||||
when: never
|
||||
- if: $UNBOUND_RELEASE_TAG_ONLY == "false"
|
||||
when: never
|
||||
- if: '$CI_COMMIT_TITLE =~ /^chore\(release\): prepare for .*$/'
|
||||
|
||||
Reference in New Issue
Block a user