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

[fix] Add uncommitted files, and remove not used build files

parent d0fc823b
No related branches found
No related tags found
No related merge requests found
Showing
with 188 additions and 0 deletions
resources/ios/icon/icon-60@2x.png

8.06 KiB

resources/ios/icon/icon-60@3x.png

14.1 KiB

resources/ios/icon/icon-72.png

4.16 KiB

resources/ios/icon/icon-72@2x.png

10.8 KiB

resources/ios/icon/icon-76.png

4.82 KiB

resources/ios/icon/icon-76@2x.png

11.4 KiB

resources/ios/icon/icon-83.5@2x.png

12.4 KiB

resources/ios/icon/icon-86@2x.png

13.2 KiB

resources/ios/icon/icon-98@2x.png

16 KiB

resources/ios/icon/icon-small.png

1.24 KiB

resources/ios/icon/icon-small@2x.png

3.28 KiB

resources/ios/icon/icon-small@3x.png

5.8 KiB

resources/ios/icon/icon.png

3.2 KiB

resources/ios/icon/icon@2x.png

8.03 KiB

resources/ubuntu/img/logo_57px.png

4.9 KiB

#!/bin/bash
# Get to the root project
if [[ "_" == "_${PROJECT_DIR}" ]]; then
SCRIPT_DIR=$(dirname $0)
PROJECT_DIR=$(cd ${SCRIPT_DIR}/.. && pwd)
export PROJECT_DIR
fi;
cd ${PROJECT_DIR}
### Control that the script is run on `dev` branch
branch=$(git rev-parse --abbrev-ref HEAD)
if [[ ! "$branch" == "master" ]];
then
echo ">> This script must be run under \`master\` branch"
exit 1
fi
### Get current version (package.json)
current=$(grep -oP "version\": \"\d+.\d+.\d+((a|b)[0-9]+)?" package.json | grep -m 1 -oP "\d+.\d+.\d+((a|b)[0-9]+)?")
if [[ "_$current" == "_" ]]; then
echo "Unable to read the current version in 'package.json'. Please check version format is: x.y.z (x and y should be an integer)."
exit 1;
fi
echo "Current version: $current"
### Get current version for Android
currentAndroid=$(grep -oP "android-versionCode=\"[0-9]+\"" config.xml | grep -oP "\d+")
if [[ "_$currentAndroid" == "_" ]]; then
echo "Unable to read the current Android version in 'config.xml'. Please check version format is an integer."
exit 1;
fi
echo "Current Android version: $currentAndroid"
# Check version format
if [[ ! $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ || ! $3 =~ ^[0-9]+$ ]]; then
echo "Wrong version format"
echo "Usage:"
echo " > ./release.sh [pre|rel] <version> <android-version> <release_description>"
echo "with:"
echo " - pre: use for pre-release"
echo " - rel: for full release"
echo " - version: x.y.z"
echo " - android-version: nnn"
echo " - release_description: a comment on release"
exit 1
fi
echo "new build version: $2"
echo "new build android version: $3"
case "$1" in
rel|pre)
# Change the version in files: 'package.json' and 'config.xml'
sed -i "s/version\": \"$current\"/version\": \"$2\"/g" package.json
currentConfigXmlVersion=$(grep -oP "version=\"\d+.\d+.\d+((a|b)[0-9]+)?\"" config.xml | grep -oP "\d+.\d+.\d+((a|b)[0-9]+)?")
sed -i "s/ version=\"$currentConfigXmlVersion\"/ version=\"$2\"/g" config.xml
sed -i "s/ android-versionCode=\"$currentAndroid\"/ android-versionCode=\"$3\"/g" config.xml
# Change version in file: 'www/manifest.json'
currentManifestJsonVersion=$(grep -oP "version\": \"\d+.\d+.\d+((a|b)[0-9]+)?\"" www/manifest.json | grep -oP "\d+.\d+.\d+((a|b)[0-9]+)?")
sed -i "s/version\": \"$currentManifestJsonVersion\"/version\": \"$2\"/g" www/manifest.json
# Bump the install.sh
sed -i "s/echo \"v.*\" #lastest/echo \"v$2\" #lastest/g" install.sh
;;
*)
echo "No task given"
exit 1
;;
esac
# Preparing Android environment
. ${PROJECT_DIR}/scripts/env-global.sh
if [[ $? -ne 0 ]]; then
exit 1
fi
echo "----------------------------------"
echo "- Compiling sources..."
echo "----------------------------------"
# Update config file
gulp config --env default_fr
# Compile
gulp build
echo "----------------------------------"
echo "- Building Android artifact..."
echo "----------------------------------"
. scripts/build-android.sh --release
if [[ $? -ne 0 ]]; then
exit 1
fi
echo "----------------------------------"
echo "- Building web artifact..."
echo "----------------------------------"
# Update config file
gulp config --env default
gulp webBuild --release
if [[ $? -ne 0 ]]; then
exit 1
fi
echo "----------------------------------"
echo "- Executing git push, with tag: v$2"
echo "----------------------------------"
# Commit
cd ${PROJECT_DIR}
git reset HEAD
git add package.json config.xml install.sh www/js/config.js www/manifest.json
if [[ $? -ne 0 ]]; then
exit 1
fi
git commit -m "v$2" && git tag "v$2" && git push
if [[ $? -ne 0 ]]; then
exit 1
fi
# Commit android project
cd ${PROJECT_DIR}/platforms/android
git reset HEAD
git add -A
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 40s, for propagation to github..."
sleep 40s
description="$4"
if [[ "_$description" == "_" ]]; then
description="Release v$2"
fi
echo "**********************************"
echo "* Uploading artifacts to Github..."
echo "**********************************"
./github.sh $1 ''"$description"''
if [[ $? -ne 0 ]]; then
exit 1
fi
echo "----------------------------------"
echo "- Building desktop artifacts..."
echo "----------------------------------"
git submodule init && git submodule sync && git submodule update --remote --merge
if [[ $? -ne 0 ]]; then
echo "Unable to sync git submodule. Could not build desktop version"
exit 1
fi
if [[ -d "${PROJECT_DIR}/dist/desktop" ]]; then
cd "${PROJECT_DIR}/dist/desktop"
# Fetch last updates
git fetch origin && git merge origin/master || exit 1
# Build desktop assets
./release.sh $2
if [[ $? -ne 0 ]]; then
exit 1
fi
else
echo "ERROR: dist/desktop not found -> Make sure git submodule has been init!"
exit 1
fi;
# back to nodejs version 6
cd ${PROJECT_DIR}
nvm use ${NODEJS_VERSION}
echo "**********************************"
echo "* Build release succeed !"
echo "**********************************"
www/img/loader.gif

1.81 KiB

www/img/search-icon-mobile.png

3.87 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment