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

[fix] Fix release scripts

parent 11fdf16d
Branches
Tags
No related merge requests found
...@@ -8,7 +8,7 @@ Cesium can be build as Web extension, for Mozilla Firefox extension (`.xpi`) and ...@@ -8,7 +8,7 @@ Cesium can be build as Web extension, for Mozilla Firefox extension (`.xpi`) and
Follow all the steps defined in the [Development guide](./development_guide.md). Follow all the steps defined in the [Development guide](./development_guide.md).
After that you should be able to start the application using `npm start`or `yarn run start`, and to test it. After that you should be able to start the application using `yarn run start`, and to test it.
## Build the web extension ## Build the web extension
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
## In a post-it ## In a post-it
```bash ```bash
# Install NodeJS v12 # Install NodeJS v16
nvm use 12 nvm use 16
npm install -g yarn npm install -g yarn
# Clone and compile from source # Clone and compile from source
...@@ -28,7 +28,7 @@ To build Cesium, you will have to: ...@@ -28,7 +28,7 @@ To build Cesium, you will have to:
sudo apt-get install git wget curl unzip build-essential software-properties-common ruby ruby-dev ruby-ffi gcc make sudo apt-get install git wget curl unzip build-essential software-properties-common ruby ruby-dev ruby-ffi gcc make
``` ```
2. Installing node.js v12 : 2. Installing node.js v16 :
* First, install [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) : * First, install [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) :
```bash ```bash
...@@ -41,7 +41,7 @@ To build Cesium, you will have to: ...@@ -41,7 +41,7 @@ To build Cesium, you will have to:
* Configure nvm to use the expected version: (**WARNING**: upper version will NOT work !) * Configure nvm to use the expected version: (**WARNING**: upper version will NOT work !)
```bash ```bash
nvm install 12 nvm install 16
``` ```
3. Installing node build tools, as global dependencies: 3. Installing node build tools, as global dependencies:
...@@ -64,7 +64,7 @@ To build Cesium, you will have to: ...@@ -64,7 +64,7 @@ To build Cesium, you will have to:
3. Installing Cordova plugins (required to build Android and iOS artifacts): 3. Installing Cordova plugins (required to build Android and iOS artifacts):
```bash ```bash
export JAVA_HOME=/path/to/jdk-8 export JAVA_HOME=/path/to/jdk-11
export PATH=$JAVA_HOME/bin:$PATH export PATH=$JAVA_HOME/bin:$PATH
ionic cordova prepare ionic cordova prepare
``` ```
...@@ -73,7 +73,7 @@ To build Cesium, you will have to: ...@@ -73,7 +73,7 @@ To build Cesium, you will have to:
> As a reminder: check that your command line is well configured: > As a reminder: check that your command line is well configured:
> - You must place yourself in the directory of the application: `cd cesium` > - You must place yourself in the directory of the application: `cd cesium`
> - and working with NodeJs **v12**: `nvm use 12` (please check using the command `node --version`) > - and working with NodeJs **v16**: `nvm use 16` (please check using the command `node --version`)
### Prepare configuration file ### Prepare configuration file
......
...@@ -36,7 +36,7 @@ RUN npm install -g cordova@"$CORDOVA_VERSION" cordova-res@"$CORDOVA_RES_VERSION" ...@@ -36,7 +36,7 @@ RUN npm install -g cordova@"$CORDOVA_VERSION" cordova-res@"$CORDOVA_RES_VERSION"
RUN echo ANDROID_HOME="${ANDROID_HOME}" >> /etc/environment && \ RUN echo ANDROID_HOME="${ANDROID_HOME}" >> /etc/environment && \
dpkg --add-architecture i386 && \ dpkg --add-architecture i386 && \
apt-get update && \ apt-get update && \
apt-get -y install openjdk-8-jdk-headless && \ apt-get -y install openjdk-11-jdk-headless && \
apt-get install -y --force-yes expect ant wget zipalign libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 qemu-kvm kmod && \ apt-get install -y --force-yes expect ant wget zipalign libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 qemu-kvm kmod && \
apt-get clean && \ apt-get clean && \
apt-get autoclean && \ apt-get autoclean && \
......
...@@ -42,7 +42,7 @@ DIST_WEB=${PROJECT_DIR}/dist/web/build ...@@ -42,7 +42,7 @@ DIST_WEB=${PROJECT_DIR}/dist/web/build
DIST_ANDROID=${PROJECT_DIR}/dist/android DIST_ANDROID=${PROJECT_DIR}/dist/android
# Addons Mozilla Web extension ID # Addons Mozilla Web extension ID
WEB_EXT_ID="{6f9922f7-a054-4609-94ce-d269993246a5}" WEB_EXT_ID=${WEB_EXT_ID:-"{6f9922f7-a054-4609-94ce-d269993246a5}"}
# /!\ WARN can be define in your <project>/.local/env.sh file # /!\ WARN can be define in your <project>/.local/env.sh file
#JAVA_HOME= #JAVA_HOME=
...@@ -121,7 +121,7 @@ else ...@@ -121,7 +121,7 @@ else
fi fi
# Checking if some global dependencies are missing # Checking if some global dependencies are missing
GLOBAL_TOOLS="yarn ionic cordova cordova-res native-run web-ext" GLOBAL_TOOLS="yarn gulp ionic cordova web-ext cordova-res native-run"
MISSING_GLOBAL_TOOLS= MISSING_GLOBAL_TOOLS=
for GLOBAL_TOOL in ${GLOBAL_TOOLS} for GLOBAL_TOOL in ${GLOBAL_TOOLS}
do do
...@@ -135,7 +135,7 @@ done ...@@ -135,7 +135,7 @@ done
# Install global dependencies # Install global dependencies
if ! test -z "${MISSING_GLOBAL_TOOLS}"; then if ! test -z "${MISSING_GLOBAL_TOOLS}"; then
echo "Installing global dependencies..." echo "Installing global dependencies..."
npm install -g yarn cordova cordova-res @ionic/cli@$IONIC_CLI_VERSION web-ext native-run npm install -g yarn gulp cordova @ionic/cli@$IONIC_CLI_VERSION web-ext cordova-res native-run
if ! test $? == 0; then if ! test $? == 0; then
echo "ERROR: Unable to install global dependencies" echo "ERROR: Unable to install global dependencies"
#exit 1 #exit 1
......
...@@ -13,7 +13,8 @@ KEY_ALIAS=Cesium ...@@ -13,7 +13,8 @@ KEY_ALIAS=Cesium
KEY_PWD= KEY_PWD=
# Preparing Android environment # Preparing Android environment
source ${PROJECT_DIR}/scripts/env-android.sh cd ${PROJECT_DIR}
source scripts/env-android.sh
[[ $? -ne 0 ]] && exit 1 [[ $? -ne 0 ]] && exit 1
APK_SIGNED_FILE=${ANDROID_OUTPUT_APK_RELEASE}/${ANDROID_OUTPUT_APK_PREFIX}-release-signed.apk APK_SIGNED_FILE=${ANDROID_OUTPUT_APK_RELEASE}/${ANDROID_OUTPUT_APK_PREFIX}-release-signed.apk
......
...@@ -9,12 +9,7 @@ fi; ...@@ -9,12 +9,7 @@ fi;
# Preparing Android environment # Preparing Android environment
cd ${PROJECT_DIR} cd ${PROJECT_DIR}
source ${PROJECT_DIR}/scripts/env-global.sh source scripts/env-global.sh
XPI_BASENAME=${PROJECT_NAME}-$current-an+fx.xpi
XPI_FILE=${PROJECT_DIR}/dist/web/build/${XPI_BASENAME}
XPI_FINAL_BASENAME=${PROJECT_NAME}-v$current-extension-firefox.xpi
XPI_FINAL_FILE=${PROJECT_DIR}/dist/web/build/${XPI_FINAL_BASENAME}
### Control that the script is run on `dev` branch ### Control that the script is run on `dev` branch
branch=$(git rev-parse --abbrev-ref HEAD) branch=$(git rev-parse --abbrev-ref HEAD)
...@@ -25,16 +20,21 @@ then ...@@ -25,16 +20,21 @@ then
fi fi
### Get version to release ### Get version to release
current=$(grep -P "version\": \"\d+.\d+.\d+(\w*)" package.json | grep -m 1 -oP "\d+.\d+.\d+(\w*)") current=$(grep -m 1 -oP "version\": \"\d+.\d+.\d+(-\w+[0-9]*)?" package.json | grep -m 1 -oP "\d+.\d+.\d+(-\w+[0-9]*)?")
if [[ "_$current" == "_" ]]; then 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)." 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; exit 1;
fi fi
echo "Sending v$current extension for Mozilla..." echo "Sending v$current extension for Mozilla..."
XPI_BASENAME=${PROJECT_NAME}-$current-an+fx.xpi
XPI_FILE=${PROJECT_DIR}/dist/web/build/${XPI_BASENAME}
XPI_FINAL_BASENAME=${PROJECT_NAME}-v$current-extension-firefox.xpi
XPI_FINAL_FILE=${PROJECT_DIR}/dist/web/build/${XPI_FINAL_BASENAME}
### Check AMO account ### Check AMO account
if [[ "_" == "_${AMO_JWT_ISSUER}" || "_" == "_${AMO_JWT_SECRET}" ]]; then if [[ "_" == "_${AMO_JWT_ISSUER}" || "_" == "_${AMO_JWT_SECRET}" ]]; then
echo "ERROR: Unable to find Addons Modzilla account: " echo "ERROR: Unable to find Addons Mozilla account: "
echo " - Please add environment variables 'AMO_JWT_ISSUER' or 'AMO_JWT_SECRET', then retry." echo " - Please add environment variables 'AMO_JWT_ISSUER' or 'AMO_JWT_SECRET', then retry."
echo " - You can use the file './local/env.sh'." echo " - You can use the file './local/env.sh'."
exit 1 exit 1
...@@ -43,6 +43,7 @@ fi ...@@ -43,6 +43,7 @@ fi
### Sign extension ### Sign extension
case "$1" in case "$1" in
pre) pre)
echo "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"
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 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 if [[ $? -ne 0 ]]; then
if [[ -f "${XPI_FILE}" || -f "${XPI_FINAL_FILE}" ]]; then if [[ -f "${XPI_FILE}" || -f "${XPI_FINAL_FILE}" ]]; then
......
...@@ -53,16 +53,16 @@ case "$1" in ...@@ -53,16 +53,16 @@ case "$1" in
rel|pre) rel|pre)
# Change the version in files: 'package.json' and 'config.xml' # Change the version in files: 'package.json' and 'config.xml'
sed -i "s/version\": \"$current\"/version\": \"$2\"/g" package.json 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]+)?") currentConfigXmlVersion=$(grep -m 1 -oP "version=\"\d+.\d+.\d+(-\w+[0-9]*)?\"" config.xml | grep -oP "\d+.\d+.\d+(-\w+[0-9]*)?")
sed -i "s/ version=\"$currentConfigXmlVersion\"/ version=\"$2\"/g" config.xml sed -i "s/ version=\"$currentConfigXmlVersion\"/ version=\"$2\"/g" config.xml
sed -i "s/ android-versionCode=\"$currentAndroid\"/ android-versionCode=\"$3\"/g" config.xml sed -i "s/ android-versionCode=\"$currentAndroid\"/ android-versionCode=\"$3\"/g" config.xml
# Change version in file: 'www/manifest.json' # 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]+)?") currentManifestJsonVersion=$(grep -m 1 -oP "version\": \"\d+.\d+.\d+(-\w+[0-9]*)?\"" www/manifest.json | grep -oP "\d+.\d+.\d+(-\w+[0-9]*)?")
sed -i "s/version\": \"$currentManifestJsonVersion\"/version\": \"$2\"/g" www/manifest.json sed -i "s/version\": \"$currentManifestJsonVersion\"/version\": \"$2\"/g" www/manifest.json
# Change version in file: 'resources/web-ext/manifest.json' # Change version in file: 'resources/web-ext/manifest.json'
currentExtManifestJsonVersion=$(grep -oP "version\": \"\d+.\d+.\d+((a|b)[0-9]+)?\"" resources/web-ext/manifest.json | grep -oP "\d+.\d+.\d+((a|b)[0-9]+)?") currentExtManifestJsonVersion=$(grep -m 1 -oP "version\": \"\d+.\d+.\d+(-\w+[0-9]*)?\"" resources/web-ext/manifest.json | grep -oP "\d+.\d+.\d+(-\w+[0-9]*)?")
sed -i "s/version\": \"$currentExtManifestJsonVersion\"/version\": \"$2\"/g" resources/web-ext/manifest.json sed -i "s/version\": \"$currentExtManifestJsonVersion\"/version\": \"$2\"/g" resources/web-ext/manifest.json
# Bump the install.sh # Bump the install.sh
...@@ -149,7 +149,8 @@ git push -f origin ...@@ -149,7 +149,8 @@ git push -f origin
echo "----------------------------------" echo "----------------------------------"
echo "- Uploading web extension to Mozilla ..." echo "- Uploading web extension to Mozilla ..."
echo "----------------------------------" echo "----------------------------------"
. ${PROJECT_DIR}/scripts/release-sign-extension.sh $1 cd ${PROJECT_DIR}/scripts || exit 1
./release-sign-extension.sh $1 ''"$description"''
# FIXME: always failed, but continue # FIXME: always failed, but continue
#[[ $? -ne 0 ]] && exit 1 #[[ $? -ne 0 ]] && exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment