Skip to content
Snippets Groups Projects
Commit 18f1a113 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Fix release script

parent ae8484e9
Branches
Tags
No related merge requests found
Pipeline #3085 passed
......@@ -5,7 +5,7 @@ branch=`git rev-parse --abbrev-ref HEAD`
if [[ ! "$branch" = "master" ]];
then
echo ">> This script must be run under \`master\` branch"
exit
exit -1
fi
......@@ -25,7 +25,7 @@ else
echo "Unable to find github authentifcation token file: "
echo " - You can create such a token at https://github.com/settings/tokens > 'Generate a new token'."
echo " - Then copy the token and paste it in the file '~/.config/duniter/.github' using a valid token."
exit
exit -1
fi
case "$1" in
......@@ -46,7 +46,7 @@ case "$1" in
else
prerelease="false"
fi
description=`echo $2`
description="$2"
result=`curl -s -H ''"$GITHUT_AUTH"'' "$REPO_URL/releases/tags/v$current"`
release_url=`echo "$result" | grep -P "\"url\": \"[^\"]+" | grep -oP "https://[A-Za-z0-9/.-]+/releases/\d+"`
......@@ -56,7 +56,7 @@ case "$1" in
if [[ "_$result" != "_" ]]; then
error_message=`echo "$result" | grep -P "\"message\": \"[^\"]+" | grep -oP ": \"[^\"]+\""`
echo "Delete existing release failed with error$error_message"
exit
exit -1
fi
else
echo "Release not exists yet on github."
......@@ -84,11 +84,12 @@ case "$1" in
echo "With:"
echo " - pre: use for pre-release"
echo " - rel: for full release"
exit
exit -1
fi
;;
*)
echo "No task given"
exit -1
;;
esac
......
......@@ -5,7 +5,7 @@ branch=`git rev-parse --abbrev-ref HEAD`
if [[ ! "$branch" = "master" ]];
then
echo ">> This script must be run under \`master\` branch"
exit
exit -1
fi
DIRNAME=`pwd`
......@@ -37,6 +37,7 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
;;
*)
echo "No task given"
exit -1
;;
esac
......@@ -49,6 +50,9 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
if [ -d "$NVM_DIR" ]; then
. $NVM_DIR/nvm.sh
nvm use 5
if [ $? -ne 0 ]; then
exit -1
fi
else
echo "nvm (Node version manager) not found (directory $NVM_DIR not found). Please install, and retry"
exit -1
......@@ -66,8 +70,9 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
echo "- Building Android artifact..."
echo "----------------------------------"
ionic build android --release
#ionic build firefoxos --release
if [ $? -ne 0 ]; then
exit -1
fi
echo "----------------------------------"
echo "- Building web artifact..."
......@@ -76,29 +81,42 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ && $3 =~ ^[0-9]+$ ]]; then
# Update config file
gulp config --env default
gulp build:web --release
cd $DIRNAME
if [ $? -ne 0 ]; then
exit -1
fi
echo "----------------------------------"
echo "- Executing git push, with tag: v$2"
echo "----------------------------------"
# Commit
cd $DIRNAME
git reset HEAD
git add package.json config.xml install.sh www/js/config.js www/manifest.json
git commit -m "v$2"
git tag "v$2"
git push
if [ $? -ne 0 ]; then
exit -1
fi
# Pause (wait propagation to from git.duniter.org to github)
echo " Waiting 30s, for propagation to github..."
sleep 30s
if [[ "_$4" != "_" ]]; then
description="$4"
if [[ "_$description" == "_" ]]; then
description="Release v$1"
fi
echo "**********************************"
echo "* Uploading artifacts to Github..."
echo "**********************************"
./github.sh $1 ''"$4"''
./github.sh $1 ''"$description"''
if [ $? -ne 0 ]; then
exit -1
fi
echo "----------------------------------"
echo "- Building desktop versions..."
......@@ -117,6 +135,9 @@ cesium-desktop-v$2-linux-x64.tar.gz"
export EXPECTED_ASSETS
./release.sh $2
if [ $? -ne 0 ]; then
exit -1
fi
# back to nodejs version 5
cd $DIRNAME
......@@ -125,23 +146,6 @@ cesium-desktop-v$2-linux-x64.tar.gz"
echo "**********************************"
echo "* Build release succeed !"
echo "**********************************"
else
echo "**********************************"
echo "* Build release succeed !"
echo "**********************************"
echo " WARN - missing arguments 'release_description'"
echo
echo " Binaries files NOT sending to github repository"
echo " Please run:"
echo " > ./github.sh pre|rel 'release_description'"
echo
echo " Desktop artifact are NOT build"
echo " Please run:"
echo " > platforms/desktop/release.sh <version>"
echo
fi
else
echo "Wrong version format"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment