Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Cesium-grp
Cesium
Commits
7ff97638
Commit
7ff97638
authored
5 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
[enh] Build as webExtension (.xpi) file
parent
5d3ec9ab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gulpfile.js
+11
-7
11 additions, 7 deletions
gulpfile.js
scripts/release.sh
+28
-2
28 additions, 2 deletions
scripts/release.sh
with
39 additions
and
9 deletions
gulpfile.js
+
11
−
7
View file @
7ff97638
...
...
@@ -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
+
'
/**/*.*
'
])
...
...
This diff is collapsed.
Click to expand it.
scripts/release.sh
+
28
−
2
View file @
7ff97638
...
...
@@ -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
artifact
s
..."
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
"----------------------------------"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment