From d5363299708fbe2f059bd0d1b7ce715eb8a4d4fb Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Fri, 30 Aug 2019 11:57:35 +0100 Subject: [PATCH 1/4] Start playing with no-sign building Could also include installation to /usr/lib/firefox/browser/extensions/ but I haven't been able to get that to work with unsigned extensions yet. --- scripts/sign | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/sign b/scripts/sign index 51b91598..32643fb7 100755 --- a/scripts/sign +++ b/scripts/sign @@ -25,6 +25,30 @@ publish_beta() { sign_and_submit } +build_no_sign_beta(){ + yarn run clean + yarn run build + scripts/version.js beta + sed 's/"name": "Tridactyl"/"name": "Tridactyl: Beta"/' -i build/manifest.json + mkdir -p web-ext-artifacts + web-ext build --source-dir ./build --overwrite-dest + for f in web-ext-artifacts/*.zip; do + mv $f ${f%.zip}.xpi + done +} + +build_no_sign_stable(){ + yarn run clean + yarn run build + scripts/version.js beta + sed 's/tridactyl.vim.betas@cmcaine/tridactyl.vim@cmcaine/' -i build/manifest.json + mkdir -p web-ext-artifacts + web-ext build --source-dir ./build --overwrite-dest + for f in web-ext-artifacts/*.zip; do + mv $f ${f%.zip}.xpi + done +} + publish_stable() { yarn run clean yarn run build From 68452ff5c6391efc6e2878b1291eeb6a87be5e14 Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Mon, 23 Sep 2019 06:24:55 +0100 Subject: [PATCH 2/4] Add unsigned build path --- scripts/sign | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/sign b/scripts/sign index 32643fb7..a53f42a1 100755 --- a/scripts/sign +++ b/scripts/sign @@ -31,7 +31,7 @@ build_no_sign_beta(){ scripts/version.js beta sed 's/"name": "Tridactyl"/"name": "Tridactyl: Beta"/' -i build/manifest.json mkdir -p web-ext-artifacts - web-ext build --source-dir ./build --overwrite-dest + $(yarn bin)/web-ext build --source-dir ./build --overwrite-dest for f in web-ext-artifacts/*.zip; do mv $f ${f%.zip}.xpi done @@ -40,10 +40,9 @@ build_no_sign_beta(){ build_no_sign_stable(){ yarn run clean yarn run build - scripts/version.js beta sed 's/tridactyl.vim.betas@cmcaine/tridactyl.vim@cmcaine/' -i build/manifest.json mkdir -p web-ext-artifacts - web-ext build --source-dir ./build --overwrite-dest + $(yarn bin)/web-ext build --source-dir ./build --overwrite-dest for f in web-ext-artifacts/*.zip; do mv $f ${f%.zip}.xpi done @@ -59,6 +58,8 @@ publish_stable() { case $1 in stable) publish_stable;; + nosignstable) build_no_sign_stable;; + nosignbeta) build_no_sign_beta;; nonewtab) publish_beta_nonewtab;; *|beta) publish_beta;; esac From 67c2a9edc405303a4c19eb01e92c05caadcdff8a Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Mon, 23 Sep 2019 06:31:35 +0100 Subject: [PATCH 3/4] Add manual install steps for unsigned builds --- scripts/get_id_from_xpi.sh | 4 ++++ scripts/install.sh | 4 ++++ 2 files changed, 8 insertions(+) create mode 100755 scripts/get_id_from_xpi.sh create mode 100755 scripts/install.sh diff --git a/scripts/get_id_from_xpi.sh b/scripts/get_id_from_xpi.sh new file mode 100755 index 00000000..1586a458 --- /dev/null +++ b/scripts/get_id_from_xpi.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +temp=$(mktemp -d) +unzip -qq $1 -d $temp +jq '.applications.gecko.id' $temp/manifest.json | tr -d '"' diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 00000000..535b116d --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +installdir=${1:-/usr/lib/firefox/browser/extensions} +xpi=web-ext-artifacts/$(ls -t web-ext-artifacts/ | head -n1) +install -Dm644 $xpi $installdir/$(scripts/get_id_from_xpi.sh $xpi).xpi From c8a7fa6a924825cd7c797666fd4466cf143ce28d Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Mon, 23 Sep 2019 07:05:35 +0100 Subject: [PATCH 4/4] Add notes on unsigned builds --- readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.md b/readme.md index caf62c39..2d3e7d12 100644 --- a/readme.md +++ b/readme.md @@ -248,6 +248,10 @@ yarn run build If you want to build a signed copy (e.g. for the non-developer release), you can do that with `web-ext sign`. You'll need some keys for AMO and to edit the application id in `src/manifest.json`. There's a helper script in `scripts/sign` that's used by our build bot and for manual releases. +You can build unsigned copies with `scripts/sign nosign{stable,beta}`. NB: The `stable` versus `beta` part of the argument tells our build process which extension ID to use (and therefore which settings to use). If you want a stable build, make sure you are on the latest tag, i.e. `git checkout $(git tag | grep '^[0-9]\+\.[0-9]\+\.[0-9]\+$' | sort -t. -k 1,1n -k 2,2n -k 3,3n | tail -1)`. + +If you are on a distribution which builds Firefox with `--with-unsigned-addon-scopes=` set to `app` and/or `system` (which is most of them by users: Arch, Debian, Ubuntu), you can install your unsigned copy of Tridactyl with `scripts/install.sh [directory]`. If you're on Arch, the correct directory is probably selected by default; on other distributions you might have to go hunting, but it probably looks like `/usr/lib/firefox/browser/extensions`. + ### Building on Windows - Install [Git for Windows][win-git]