From afb15bb1db5d82ee2bf3fd056718e52a4edbee03 Mon Sep 17 00:00:00 2001 From: Tigran Mkrtchyan Date: Mon, 30 Oct 2023 10:46:22 +0100 Subject: [PATCH] ci: generate release-notes template --- .ci/generate-changelog.sh | 22 ++++++++++++++++++++++ .gitlab-ci.yml | 20 ++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100755 .ci/generate-changelog.sh diff --git a/.ci/generate-changelog.sh b/.ci/generate-changelog.sh new file mode 100755 index 00000000000..2aec8091672 --- /dev/null +++ b/.ci/generate-changelog.sh @@ -0,0 +1,22 @@ +#!/bin/sh + + +SRM_RPM_NAME=`ls modules/srm-client/target/rpmbuild/RPMS/noarch/ | grep dcache-srmclient` +SRM_RPM_SUM=`md5sum modules/srm-client/target/rpmbuild/RPMS/noarch/$SRM_RPM_NAME | cut -d ' ' -f 1` +DEB_NAME=`ls packages/fhs/target/ | grep dcache` +DEB_SUM=`md5sum packages/fhs/target/$DEB_NAME | cut -d ' ' -f 1` +TAR_NAME=`ls packages/tar/target/ | grep dcache` +TAR_SUM=`md5sum packages/tar/target/$TAR_NAME | cut -d ' ' -f 1` +RPM_NAME=`ls packages/fhs/target/rpmbuild/RPMS/noarch/ | grep dcache` +RPM_SUM=`md5sum packages/fhs/target/rpmbuild/RPMS/noarch/$RPM_NAME | cut -d ' ' -f 1` +DATE=`date +"%Y.%m.%d"` + +echo "| Download | Build date | md5 sum |" +echo "|:-----------|:-----------|----------|" +echo "| $RPM_NAME | $DATE | $RPM_SUM |" +echo "| $DEB_NAME | $DATE | $DEB_SUM |" +echo "| $TAR_NAME | $DATE | $TAR_SUM |" +echo "| $SRM_RPM_NAME | $DATE | $SRM_RPM_SUM |" + +echo ; echo; echo +git log `git describe --tags --abbrev=0`...`git describe --tags --abbrev=0 HEAD^` --no-merges --format='[%h](https://github.com/dcache/dcache/commit/%H)%n: %s%n' \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e4f3724ffcb..4aea543d9b8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -316,6 +316,26 @@ upload_container: --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination dcache/dcache:$tag + +# +# This jobs needs that the number of changes to fetch from GitLab when cloning a repository is high enough to generate +# the changelog. +Generate release notes: + image: almalinux:9-minimal + stage: upload + extends: .upload_rules + dependencies: + - sign_deb + - sign_rpm + - sign_srm_client_rpm + - tar + script: + - microdnf install -y git-core + - .ci/generate-changelog.sh >> release-$CI_COMMIT_TAG.md + artifacts: + paths: + - release-*.md + # # prepare kubernetes env for the build #