From 69d1b88a18f1b96e303e6d547670d158b2b15f33 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Wed, 2 Oct 2024 07:43:04 +0200 Subject: [PATCH] ci: add prepare_release stage to generate CHANGELOG.md for release --- .gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index be5b30a..e01d66a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,9 +2,26 @@ include: - template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml' stages: +- prepare - build build: stage: build script: - env | sort + +prepare_release: + stage: prepare + image: + name: orhunp/git-cliff:latest + entrypoint: [ "" ] + variables: + GIT_STRATEGY: clone # clone entire repo instead of reusing workspace + GIT_DEPTH: 0 # avoid shallow clone to give cliff all the info it needs + script: + - git-cliff --current > CHANGELOG.md + artifacts: + paths: + - CHANGELOG.md + rules: + - if: $CI_DEFAULT_BRANCH == $CI_COMMIT_BRANCH