diff --git a/platforms/android b/platforms/android index 9bc41782abff7603acd0baf0d327d4c854341f9c..1b4d4bebcd8deb806afb9abcdf296d0f3a76025e 160000 --- a/platforms/android +++ b/platforms/android @@ -1 +1 @@ -Subproject commit 9bc41782abff7603acd0baf0d327d4c854341f9c +Subproject commit 1b4d4bebcd8deb806afb9abcdf296d0f3a76025e diff --git a/scripts/env-global.sh b/scripts/env-global.sh index 3b486285a647568de30c4035877a23bbf2e0a49c..26ebd2b912248720091e52465111f12cd8f65bec 100755 --- a/scripts/env-global.sh +++ b/scripts/env-global.sh @@ -33,6 +33,9 @@ ANDROID_OUTPUT_APK_RELEASE=${ANDROID_OUTPUT_APK}/release DIST_WEB=${PROJECT_DIR}/dist/web/build DIST_ANDROID=${PROJECT_DIR}/dist/android +# Addons Modzilla ID +WEB_EXT_ID="{6f9922f7-a054-4609-94ce-d269993246a5}" + #JAVA_HOME= GRADLE_VERSION=4.10.3 diff --git a/scripts/release-sign-extension.sh b/scripts/release-sign-extension.sh new file mode 100755 index 0000000000000000000000000000000000000000..7077b40d9d46eacbddb20afadb94c5a0fa1ff4b7 --- /dev/null +++ b/scripts/release-sign-extension.sh @@ -0,0 +1,58 @@ +#!/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; + +# Preparing Android environment +cd ${PROJECT_DIR} +. ${PROJECT_DIR}/scripts/env-global.sh + +### 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 version to release +current=$(grep -P "version\": \"\d+.\d+.\d+(\w*)" package.json | grep -m 1 -oP "\d+.\d+.\d+(\w*)") +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 "Sending v$current extension for Mozilla..." + +### Check AMO account +if [[ "_" == "_${AMO_JWT_ISSUER}" || "_" == "_${AMO_JWT_SECRET}" ]]; then + echo "ERROR: Unable to find Addons Modzilla account: " + echo " - Please add environment variables 'AMO_JWT_ISSUER' or 'AMO_JWT_SECRET', then retry." + echo " - You can use the file './local/env.sh'." + exit 1 +fi + +### Sign extension +case "$1" in + pre) + web-ext sign "--api-key=${AMO_JWT_ISSUER}" "--api-secret=${AMO_JWT_SECRET}" "--source-dir=${PROJECT_DIR}/dist/web/ext" "--artifacts-dir=${PROJECT_DIR}/dist/web/build" --id=${WEB_EXT_ID} --channel=unlisted + if [[ $? -ne 0 ]]; then + exit 1 + fi + ;; + rel) + web-ext sign "--api-key=${AMO_JWT_ISSUER}" "--api-secret=${AMO_JWT_SECRET}" "--source-dir=${PROJECT_DIR}/dist/web/ext" "--artifacts-dir=${PROJECT_DIR}/dist/web/build" --id=${WEB_EXT_ID} --channel=listed + if [[ $? -ne 0 ]]; then + exit 1 + fi + ;; + *) + echo "No task given" + echo "Usage:" + echo " > $0 pre|rel <release_description>" + exit 1 + ;; +esac diff --git a/scripts/github.sh b/scripts/release-to-github.sh similarity index 97% rename from scripts/github.sh rename to scripts/release-to-github.sh index 1e04c2241041c430fa173c696a00254986d74884..b66eb757d68499c22b4fa2bb1d37633314f3e8e0 100755 --- a/scripts/github.sh +++ b/scripts/release-to-github.sh @@ -25,7 +25,7 @@ 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" +echo "Sending v$current extension to Github..." ### get auth token GITHUB_TOKEN=$(cat ~/.config/${PROJECT_NAME}/.github) @@ -145,7 +145,7 @@ case "$1" in else echo "Wrong arguments" echo "Usage:" - echo " > ./github.sh del|pre|rel <release_description>" + echo " > $0 del|pre|rel <release_description>" echo "With:" echo " - del: delete existing release" echo " - pre: use for pre-release" @@ -155,6 +155,8 @@ case "$1" in ;; *) echo "No task given" + echo "Usage:" + echo " > $0 del|pre|rel <release_description>" exit 1 ;; esac diff --git a/scripts/release.sh b/scripts/release.sh index 5239f7ce35f69a08c2fc96f304bf54f59d1148c7..75d0d171719201a32ca03d9be46be0ea5e6953be 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -107,7 +107,7 @@ cp ${APK_RELEASE_FILE} "${DIST_ANDROID}/${PROJECT_NAME}-v$2-android.apk" || exit echo "----------------------------------" -echo "- Building web and webExtension artifacts..." +echo "- Building web and extension artifacts..." echo "----------------------------------" cd ${PROJECT_DIR} || exit 1 gulp config --env default @@ -152,43 +152,20 @@ if [[ $? -ne 0 ]]; then fi echo "----------------------------------" -echo "- Push git android project..." +echo "- Uploading web extension to Modzilla ..." echo "----------------------------------" +. ${PROJECT_DIR}/scripts/release-sign-extension.sh $1 +# FIXME: always failed: but continue +#if [[ $? -ne 0 ]]; then +# exit 1 +#fi -# Commit android project -cd ${PROJECT_DIR}/platforms/android || exit 1 -git reset HEAD -git add -A -git commit -m "v$2" -git tag -f -a "v$2" -m "${description}" -# Push the tag -git push origin "v$2" -# Push the master branch -git push origin -if [[ $? -ne 0 ]]; then - echo "ERROR: cannot push platform/android project ! Continue anyway..." -fi - -echo "**********************************" -echo "* Upload web extension to {addons.modzilla.org} ..." -echo "**********************************" -if [[ "_" == "_${AMO_JWT_ISSUER}" ||Â "_" == "_${AMO_JWT_SECRET}" ]]; then - echo "WARN: Cannot send webExtension to Modzilla: missing env variable 'AMO_JWT_ISSUER' or 'AMO_JWT_SECRET'. Use local file './local/env.sh' to define it, then retry." -else - web-ext sign --api-key=${AMO_JWT_ISSUER} --api-secret=${AMO_JWT_SECRET} --id=${AMO_APP_ID} --source-dir=${PROJECT_DIR}/dist/web/ext --artifacts-dir=${PROJECT_DIR}/dist/web/build - if [[ $? -ne 0 ]]; then - exit 1 - fi -fi - -echo "**********************************" -echo "* Uploading artifacts to {github.com} ..." -echo "**********************************" +echo "----------------------------------" +echo "- Uploading artifacts to Gihub ..." +echo "----------------------------------" # Pause (wait propagation to from git.duniter.org to github) -echo " Waiting 40s, for propagation to github..." -sleep 40s - -. ${PROJECT_DIR}/scripts/github.sh $1 ''"$description"'' +echo " Waiting 40s, for propagation to github..." && sleep 40s +. ${PROJECT_DIR}/scripts/release-to-github.sh $1 ''"$description"'' if [[ $? -ne 0 ]]; then exit 1 fi @@ -196,17 +173,23 @@ fi echo "----------------------------------" echo "- Building desktop artifacts..." echo "----------------------------------" -. ${PROJECT_DIR}/scripts/release-desktop.sh $2 +. ${PROJECT_DIR}/scripts/release-desktop.sh $2 ''"$description"'' if [[ $? -ne 0 ]]; then exit 1 fi - -# Back to nodejs -cd ${PROJECT_DIR} +# Back to nodejs project version nvm use ${NODEJS_VERSION} +echo "----------------------------------" +echo "- Push git android project..." +echo "----------------------------------" +. ${PROJECT_DIR}/scripts/release-android-sources.sh $2 ''"$description"'' + echo "**********************************" echo "* Build release succeed !" echo "**********************************" +# Back to nodejs project version +nvm use ${NODEJS_VERSION} + diff --git a/www/js/config.js b/www/js/config.js index 1a48774296a7a6a0533a8cd5bc987001f8699d96..76735856c39dd31be082f33b33ea8bab6ff2f367 100644 --- a/www/js/config.js +++ b/www/js/config.js @@ -10,10 +10,10 @@ angular.module("cesium.config", []) .constant("csConfig", { "cacheTimeMs": 300000, - "fallbackLanguage": "en", + "fallbackLanguage": "fr", "rememberMe": true, "showUDHistory": true, - "timeout": 40000, + "timeout": 300000, "timeWarningExpireMembership": 5184000, "timeWarningExpire": 7776000, "keepAuthIdle": 600, @@ -31,8 +31,8 @@ angular.module("cesium.config", []) } }, "license": { - "en": "license/license_g1-en", "fr-FR": "license/license_g1-fr-FR", + "en": "license/license_g1-en", "es-ES": "license/license_g1-es-ES", "eo-EO": "license/license_g1-eo-EO" }, @@ -44,12 +44,12 @@ angular.module("cesium.config", []) "maxContentLength": 650 }, "node": { - "host": "g1.duniter.org", + "host": "g1.duniter.fr", "port": 443 }, "fallbackNodes": [ { - "host": "g1.cgeek.fr", + "host": "g1.duniter.fr", "port": 443 }, { @@ -61,14 +61,12 @@ angular.module("cesium.config", []) "port": 443 }, { - "host": "g1.duniter.fr", + "host": "duniter.normandie-libre.fr", "port": 443 - } - ], - "developers": [ + }, { - "name": "Benoit Lavenier", - "pubkey": "38MEAZN68Pz1DTvT3tqgxx4yQP6snJCQhPqEFxbDk4aE" + "host": "g1.duniter.org", + "port": 443 } ], "plugins": { @@ -98,7 +96,7 @@ angular.module("cesium.config", []) } }, "version": "1.5.5", - "build": "2020-03-06T13:47:02.630Z", + "build": "2020-03-06T14:22:26.485Z", "newIssueUrl": "https://git.duniter.org/clients/cesium-grp/cesium/issues/new" })