Commit 40ef6bb1 authored by Benoit Lavenier's avatar Benoit Lavenier

[fix] Github updaload should used tags created by Maven build

parent cb75f275
Pipeline #4302 failed
......@@ -11,6 +11,7 @@ fi
### Get version to release
current=`grep -m1 -P "\<version>[0-9A−Z.]+(-\w*)?</version>" pom.xml | grep -oP "\d+.\d+.\d+(-\w*)?"`
echo "Current version: $current"
remote_tag=cesium-plus-pod-$current
### Get repo URL
REPO="duniter/cesium-plus-pod"
......@@ -29,7 +30,7 @@ fi
case "$1" in
del)
result=`curl -i "$REPO_URL/releases/tags/v$current"`
result=`curl -i "$REPO_URL/releases/tags/$remote_tag"`
release_url=`echo "$result" | grep -P "\"url\": \"[^\"]+" | grep -oP "$REPO_URL/releases/\d+"`
if [[ $release_url != "" ]]; then
echo "Deleting existing release..."
......@@ -50,7 +51,7 @@ case "$1" in
description="Release v$current"
fi
result=`curl -s -H ''"$GITHUT_AUTH"'' "$REPO_URL/releases/tags/v$current"`
result=`curl -s -H ''"$GITHUT_AUTH"'' "$REPO_URL/releases/tags/$remote_tag"`
release_url=`echo "$result" | grep -P "\"url\": \"[^\"]+" | grep -oP "https://[A-Za-z0-9/.-]+/releases/\d+"`
if [[ "_$release_url" != "_" ]]; then
echo "Deleting existing release... $release_url"
......@@ -65,9 +66,9 @@ case "$1" in
fi
echo "Creating new release..."
echo " - tag: v$current"
echo " - tag: $remote_tag"
echo " - description: $description"
result=`curl -H ''"$GITHUT_AUTH"'' -s $REPO_URL/releases -d '{"tag_name": "v'"$current"'","target_commitish": "master","name": "'"$current"'","body": "'"$description"'","draft": false,"prerelease": '"$prerelease"'}'`
result=`curl -H ''"$GITHUT_AUTH"'' -s $REPO_URL/releases -d '{"tag_name": "'"$remote_tag"'","target_commitish": "master","name": "'"$current"'","body": "'"$description"'","draft": false,"prerelease": '"$prerelease"'}'`
#echo "$result"
upload_url=`echo "$result" | grep -P "\"upload_url\": \"[^\"]+" | grep -oP "https://[A-Za-z0-9/.-]+"`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment