diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 94bf7d6395b9589d9e8d5fe26bf6697ffe3061aa..a7d07d19ed378f632bb223c38fc39e5d3656de71 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,3 +31,21 @@ publish: - yarn publish --new-version "$CI_COMMIT_TAG" rules: - if: '$CI_COMMIT_TAG' + +gitlab-release: + stage: publish + image: registry.gitlab.com/gitlab-org/release-cli + variables: + GIT_STRATEGY: clone + GIT_DEPTH: 0 + before_script: + - apk add --no-cache git + - export RELEASE_NAME="Markdown Spellchecker $CI_COMMIT_TAG" + - export RELEASE_DESCRIPTION="$(printf '## Changelog\n\n' && git log --no-merges --pretty="- %s (%h)" "HEAD...$(git tag | sort -V -r | head -1)" && printf '\n\n## External Contributors\n\n' && git log --pretty="- %an%n- %cn" HEAD...$(git tag | sort -V -r | head -1) | sort | uniq | grep -v 'Sheogorath' && printf "\n\n---\n*This is an automated release. See [#${CI_JOB_ID}]($CI_JOB_URL) for details.*")" + script: + - > + release-cli create --name "$RELEASE_NAME" --description "$RELEASE_DESCRIPTION" + --tag-name "${CI_COMMIT_TAG}" --ref "$CI_COMMIT_SHA" + rules: + - if: '$CI_COMMIT_TAG' +