summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorhackademix2018-08-24 02:56:59 +0200
committerhackademix2018-08-24 02:56:59 +0200
commit21c91ece08293c20868d575204065462c09b57a9 (patch)
treee24ae68846a14375bbae5ee510635ded190e60f9 /build.sh
parentd4e1ef5c8732fa43dc4bca2f68f98dcda2849ac6 (diff)
downloadnoscript-21c91ece08293c20868d575204065462c09b57a9.tar.gz
noscript-21c91ece08293c20868d575204065462c09b57a9.tar.xz
noscript-21c91ece08293c20868d575204065462c09b57a9.zip
build.sh support for quick stable release
Diffstat (limited to 'build.sh')
-rw-r--r--build.sh25
1 files changed, 16 insertions, 9 deletions
diff --git a/build.sh b/build.sh
index 5752c63..2e70909 100644
--- a/build.sh
+++ b/build.sh
@@ -11,12 +11,17 @@ if [ "$1" == "tag" ]; then
git tag -a "$VER" && git push origin "$VER"
exit 0
fi
+if [ "$1" == "rel" ]; then
+ perl -pi -e 's/("version":.*)rc\d+/$1/' "$MANIFEST_IN" && rm "$MANIFEST_IN".bak
+ "$0" && "$0" bump
+ exit
+fi
if [ "$1" == "bump" ]; then
echo "Bumping to $VER"
git add "$MANIFEST_IN"
git commit -m "Version bump: $VER."
[[ $VER == *rc* ]] || "$0" tag
- exit 0
+ exit
fi
XPI_DIR="$BASE/xpi"
XPI="$XPI_DIR/noscript-$VER"
@@ -33,11 +38,21 @@ rm -rf "$BUILD" "$XPI"
cp -pR "$SRC" "$BUILD"
cp -p LICENSE.txt GPL.txt "$BUILD"/
+BUILD_CMD="web-ext"
+BUILD_OPTS="build"
+
if [[ $VER == *rc* ]]; then
sed -re 's/^(\s+)"strict_min_version":.*$/\1"update_url": "https:\/\/secure.informaction.com\/update\/?v='$VER'",\n\0/' \
"$MANIFEST_IN" > "$MANIFEST_OUT"
+ if [ "$1" == "sign" ]; then
+ BUILD_CMD="$BASE/../../we-sign"
+ BUILD_OPTS=""
+ fi
else
grep -v '"update_url":' "$MANIFEST_IN" > "$MANIFEST_OUT"
+ if [ "$1" == "sign" ]; then
+ echo >&2 "WARNING: won't auto-sign a release version, please manually upload to AMO."
+ fi
fi
if ! grep '"id":' "$MANIFEST_OUT" >/dev/null; then
echo >&2 "Cannot build manifest.json"
@@ -50,14 +65,6 @@ for file in "$SRC"/content/*.js; do
fi
done
-if [ "$1" == "sign" ]; then
- BUILD_CMD="$BASE/../../we-sign"
- BUILD_OPTS=""
-else
- BUILD_CMD="web-ext"
- BUILD_OPTS="build"
-fi
-
echo "Creating $XPI.xpi..."
mkdir -p "$XPI_DIR"