diff --git a/gulpfile.js b/gulpfile.js index c6428fe3ec88d2674b896de0f66b7520c6eb2f27..6d974a6628d816ae438a708d00dbe75bacc703ca 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -629,22 +629,26 @@ function webExtCopyFiles() { const resourcesPath = './resources/web-ext'; return gulp.src([ wwwPath + '/**/*', - wwwPath + '/dist_js/*.*', - // Remove debug JS files + // Remove JS debug files + wwwPath + '/dist_js/*.*', '!' + wwwPath + '/dist_js/cesium.js', '!' + wwwPath + '/dist_js/vendor.js', - '!' + wwwPath + '/dist_js/cesium-api*.js', - '!' + wwwPath + '/dist_js/vendor-api*.js', + '!' + wwwPath + '/dist_js/cesium-api.js', + '!' + wwwPath + '/dist_js/vendor-api.js', + // Remove CSS debug files wwwPath + '/dist_css/*.*', - // Remove debug CSS files '!' + wwwPath + '/dist_css/cesium.css', '!' + wwwPath + '/dist_css/cesium-api*.css', + + // Remove HTML debug files + wwwPath + '/api/*', + '!' + wwwPath + '/api/debug.html', '!' + wwwPath + '/debug.html', - '!' + wwwPath + '/manifest.json', - // Add specific resource + // Add specific resource (and overwrite the default 'manifest.json') + '!' + wwwPath + '/manifest.json', resourcesPath + '/**/*.*' ]) diff --git a/scripts/release.sh b/scripts/release.sh index 48d5e25895d254827a3c4672b8cec95108288c0c..005bab6b6dbc9154358e9417decaa969a4e9c2e3 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -61,6 +61,10 @@ case "$1" in 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 + # 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]+)?") + sed -i "s/version\": \"$currentExtManifestJsonVersion\"/version\": \"$2\"/g" resources/web-ext/manifest.json + # Bump the install.sh sed -i "s/echo \"v.*\" #lastest/echo \"v$2\" #lastest/g" install.sh ;; @@ -103,7 +107,7 @@ cp ${APK_RELEASE_FILE} "${DIST_ANDROID}/${PROJECT_NAME}-v$2-android.apk" || exit echo "----------------------------------" -echo "- Building web artifact..." +echo "- Building web and webExtension artifacts..." echo "----------------------------------" cd ${PROJECT_DIR} || exit 1 gulp config --env default @@ -116,6 +120,11 @@ if [[ ! -f "${DIST_WEB_FILE}" ]]; then echo "ERROR: Missing web artifact at ${DIST_WEB_FILE}" exit 1 fi; +DIST_WEB_EXT_FILE="${DIST_WEB}/${PROJECT_NAME}-v$2-extension.xpi" +if [[ ! -f "${DIST_WEB_EXT_FILE}" ]]; then + echo "ERROR: Missing web-ext artifact at ${DIST_WEB_EXT_FILE}" + exit 1 +fi; echo "----------------------------------" echo "- Executing git push, with tag: v$2" @@ -128,7 +137,7 @@ fi # Commit cd ${PROJECT_DIR} || exit 1 git reset HEAD -git add package.json config.xml install.sh www/js/config.js www/manifest.json +git add package.json config.xml install.sh www/js/config.js www/manifest.json resources/web-ext/manifest.json if [[ $? -ne 0 ]]; then exit 1 fi @@ -156,6 +165,22 @@ if [[ $? -ne 0 ]]; then exit 1 fi +echo "**********************************" +echo "* Upload web extension to Modzilla..." +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 + + +exit 1 + echo "**********************************" echo "* Uploading artifacts to Github..." echo "**********************************" @@ -168,6 +193,7 @@ if [[ $? -ne 0 ]]; then exit 1 fi + echo "----------------------------------" echo "- Building desktop artifacts..." echo "----------------------------------"