Skip to content
Snippets Groups Projects
Commit 2efe4fd7 authored by David Byers's avatar David Byers
Browse files

Prepare for CI/CD builds of signed beta.

parent 6531a9d7
No related branches found
No related tags found
1 merge request!8Beta
Pipeline #33125 failed
......@@ -3,8 +3,9 @@ stages:
- build
- deploy
build:
.build:
stage: build
image: gitlab.it.liu.se:5000/serverdrift-projs/ci/node:lts
script:
- apt-get -y update
- apt-get -y install zip python3-minimal
......@@ -14,6 +15,18 @@ build:
- ./build/safelinks-cleaner-thunderbird.xpi
- ./build/safelinks-cleaner-firefox.xpi
build:release:
extends: .build
only:
- master
build:beta:
extends: .build
variables:
BETA_BUILD: yes
only:
- beta
pages:
stage: deploy
script:
......
......@@ -6,7 +6,7 @@ similar extensions it does not change the links, but does ensure that
they are displayed in such a way that the original link is accessible.
The extension currently builds for Thunderbird and Firefox (it will
only affect links on outlook.com).
only affect links on office.com and office365.com).
* Links in plain text email are changed so the original link is
displayed.
......
{
"browser_specific_settings": {
"gecko": {
"id": "safelinks-cleaner@it.liu.se",
"update_url": "https://safelinks.gitlab-pages.liu.se/safelinks-cleaner-thunderbird/%XPIFILE%"
}
}
}
......@@ -2,16 +2,61 @@
set -eu
usage() {
cat <<EOF
Usage: $0 [--beta] [--debug]
EOF
exit 1
}
beta="${BETA_BUILD:-}"
debug="${DEBUG_BUILD:-}"
while [ $# -gt 0 ] ; do
case "$1" in
--beta)
beta=yes
;;
--debug)
debug=yes
;;
--)
shift
break
;;
-h|--help)
usage
;;
-*)
usage
;;
*)
break
;;
esac
shift
done
[ $# -eq 0 ] || usage
TARGETS=(thunderbird firefox)
BASEDIR="$( cd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null 2>&1 && pwd )"
BUILDDIR="$BASEDIR/build"
SHAREDDIR="$BASEDIR/shared"
VERSION="$(cat "$BASEDIR/version.txt")"
if [ "$beta" ] ; then
VERSION="$VERSION-dev"
fi
declare -a manifests
for target in "${TARGETS[@]}" ; do
targetdir="$BUILDDIR/$target"
sourcedir="$BASEDIR/$target"
outputfile="$BUILDDIR/safelinks-cleaner-$target.xpi"
xpifile="safelinks-cleaner-$target.xpi"
outputfile="$BUILDDIR/$xpifile"
echo "[+] building target '$target'"
[ -d "$targetdir" ] && rm -r "$targetdir"
......@@ -19,7 +64,10 @@ for target in "${TARGETS[@]}" ; do
cp -r "$SHAREDDIR"/* "$targetdir"
cp -r "$sourcedir"/* "$targetdir"
rm "$targetdir"/manifest.part.json
rm -f "$targetdir"/manifest.part.json \
"$targetdir"/manifest.beta.part.json \
"$targetdir"/*~ \
"$targetdir"/#*
if [ -z "${DEBUG:-}" ] ; then
for file in "$targetdir"/*.js ; do
......@@ -27,10 +75,20 @@ for target in "${TARGETS[@]}" ; do
done
fi
manifests=("$SHAREDDIR/manifest.part.json"
"$sourcedir/manifest.part.json")
if [ "$beta" -a -f "$sourcedir/manifest.beta.part.json" ] ; then
manifests+=("$sourcedir/manifest.beta.part.json")
fi
python3 "$BASEDIR/scripts/makemanifest.py" \
"$SHAREDDIR/manifest.part.json" \
"$sourcedir/manifest.part.json" \
"${manifests[@]}" \
> "$targetdir/manifest.json"
sed -i -e "s/%XPIFILE%/$xpifile/g" "$targetdir/manifest.json"
sed -i -e "s/%VERSION%/$VERSION/g" "$targetdir/manifest.json"
(cd "$targetdir" ; zip -r "$outputfile" *)
echo "[-] output to '$outputfile'"
done
......@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "ATP Safe Links Cleaner",
"description": "__MSG_extensionDescription__",
"version": "1.4",
"version": "%VERSION%",
"author": "David Byers",
"homepage_url": "https://gitlab.liu.se/safelinks/safelinks-cleaner/",
"default_locale": "en",
......
{
"applications": {
"gecko": {
"update_url": "https://safelinks.gitlab-pages.liu.se/safelinks-cleaner-thunderbird/%XPIFILE%"
}
}
}
{
"applications": {
"gecko": {
"id": "safelinks-cleaner-thunderbird@it.liu.se",
"id": "safelinks-cleaner@it.liu.se",
"strict_min_version": "78.4.0"
}
},
......
1.5
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment