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

[fix] Release: clarify release script (split web-ext sign)

parent 6ed1f8bd
No related branches found
No related tags found
No related merge requests found
Subproject commit 9bc41782abff7603acd0baf0d327d4c854341f9c
Subproject commit 1b4d4bebcd8deb806afb9abcdf296d0f3a76025e
......@@ -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
......
#!/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
......@@ -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
......@@ -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}
......@@ -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"
})
......
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