Update GitLab CI to save changelog to CHANGELOG file

This commit is contained in:
rnsrk 2025-05-11 22:30:24 +02:00
parent cec51554d0
commit c2b8dc716b

View file

@ -4,10 +4,9 @@ stages:
create_release: create_release:
stage: release stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest image: registry.gitlab.com/gitlab-org/release-cli:latest
only:
- tags
rules: rules:
- if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+.*$/ - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+.*$/
- when: never
script: script:
- | - |
# Get the previous tag to generate changelog # Get the previous tag to generate changelog
@ -21,9 +20,9 @@ create_release:
fi fi
# Save changelog to file for release # Save changelog to file for release
echo -e "## Changes\n$CHANGELOG" > changelog.md echo -e "## Changes\n$CHANGELOG" > CHANGELOG
release: release:
name: 'Release $CI_COMMIT_TAG' name: 'Release $CI_COMMIT_TAG'
tag_name: '$CI_COMMIT_TAG' tag_name: '$CI_COMMIT_TAG'
description: './changelog.md' description: './CHANGELOG'
ref: '$CI_COMMIT_TAG' ref: '$CI_COMMIT_TAG'