From 118a951f5344af01a30f3d0e26180273ecc7c2e6 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Thu, 21 Mar 2019 13:06:56 +0100
Subject: [PATCH] Fix issue with automatic generation of changelog

---
 tools/release.sh | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/release.sh b/tools/release.sh
index 5786ecf66..eedc3ce31 100755
--- a/tools/release.sh
+++ b/tools/release.sh
@@ -10,6 +10,7 @@ function gen_changelog()
     lastline=$(( lastline - 1 ))
     #echo $lastline
 
+    changelog="Changes:\n"
     for i in `seq $firstline $lastline`
     do
         local line=$( head -n $i ChangeLog | tail -n 1 )
@@ -17,7 +18,7 @@ function gen_changelog()
         #echo $line
     done
 
-    changelog="${changelog}\nWARNING: Download the source archive by clicking on the link __Download release__ above, please do not consider the link Source code to get all submodules.\n"
+    changelog="${changelog}\n__WARNING__: Download the source archive by clicking on the link __Download release__ above, please do not consider the link Source code to get all submodules.\n"
 }
 
 release=""
@@ -38,6 +39,10 @@ then
     exit 1
 fi
 
+# extract the change log from ChangeLog
+gen_changelog
+echo $changelog
+
 # generate the archive
 mkdir -p build-release
 cd build-release
@@ -48,10 +53,6 @@ make package_source
 GETURL=`echo curl --request POST --header \"PRIVATE-TOKEN: $RELEASE_TOKEN\" --form \"file=\@chameleon-$RELEASE_NAME.tar.gz\" https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/uploads`
 MYURL=`eval $GETURL | jq .url | sed "s#\"##g"`
 
-# extract the change log from ChangeLog
-gen_changelog
-echo $changelog
-
 # Try to remove the release if it already exists
 curl --request DELETE --header "PRIVATE-TOKEN: $RELEASE_TOKEN" https://gitlab.inria.fr/api/v4/projects/$CI_PROJECT_ID/releases/v$RELEASE_NAME
 
-- 
GitLab