From 73dbeadfab4a88dd2053a215691a38aed4c21975 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Thu, 11 Aug 2022 21:02:27 +0100 Subject: [PATCH] Trim changelog before including in release desc --- .gitlab/release.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.gitlab/release.yml b/.gitlab/release.yml index 1b04c2e7..f1ed61da 100644 --- a/.gitlab/release.yml +++ b/.gitlab/release.yml @@ -11,13 +11,15 @@ release: script: - echo "Build Job $JOB_ID" - echo "Running release job for tag $CI_COMMIT_TAG" - release: - name: Crafty $CI_COMMIT_TAG - tag_name: $CI_COMMIT_TAG - description: ./CHANGELOG.md - ref: $CI_COMMIT_TAG - assets: - links: - - name: Windows Package - url: "$CI_PROJECT_URL/-/jobs/$JOB_ID/artifacts/download" - link_type: package + - | + full_changelog=$(cat CHANGELOG.md) + trimmed_changelog="${full_changelog%%

*}" + echo "$trimmed_changelog" + - release-cli create + --name "Crafty $CI_COMMIT_TAG" + --description "$trimmed_changelog" + --tag-name "$CI_COMMIT_TAG" + --ref "$CI_COMMIT_TAG" + --assets-link "{\"url\":\"$CI_PROJECT_URL/-/jobs/$JOB_ID/artifacts/download\",\"name\":\"Windows Package\",\"link_type\":\"package\"}" +# Having to use raw release-cli instead of yaml syntax because variables are not expanding +# https://gitlab.com/gitlab-org/gitlab/-/issues/237893#note_403465700