update manifest and build with proper id and versioning

This commit is contained in:
Mattijs
2026-11-11 20:35:06 +01:00
parent 27b76e64b5
commit 8675c3dd80
2 changed files with 15 additions and 13 deletions
+14 -12
View File
@@ -1,13 +1,16 @@
#!/bin/bash
# Builds the loadable copy of the extension:
# dist/tabpark unpacked, for about:debugging
# dist/tabpark.xpi zipped, for handing over or uploading to AMO
# dist/tabpark unpacked, for about:debugging
# dist/tabpark-<version>-unsigned.xpi zipped, for uploading to AMO
set -euo pipefail
SRC="$(cd "$(dirname "$0")/.." && pwd)"
OUT="$SRC/dist"
DEST="$OUT/tabpark"
VERSION="$(python3 -c 'import json, sys; print(json.load(open(sys.argv[1]))["version"])' "$SRC/manifest.json")"
XPI="$OUT/tabpark-$VERSION-unsigned.xpi"
rm -rf "$OUT"
mkdir -p "$DEST"
@@ -16,11 +19,10 @@ cp "$SRC"/manifest.json "$SRC"/common.js "$SRC"/background.js \
"$SRC"/options.html "$SRC"/options.js "$SRC"/options.css "$DEST"/
cp -r "$SRC"/icons "$DEST"/
python3 - "$OUT" <<'PY'
python3 - "$OUT" "$XPI" <<'PY'
import os, sys, zipfile
out = sys.argv[1]
src = os.path.join(out, 'tabpark')
xpi = os.path.join(out, 'tabpark.xpi')
src = os.path.join(sys.argv[1], 'tabpark')
xpi = sys.argv[2]
with zipfile.ZipFile(xpi, 'w', zipfile.ZIP_DEFLATED) as archive:
for root, _, files in os.walk(src):
for filename in files:
@@ -28,15 +30,15 @@ with zipfile.ZipFile(xpi, 'w', zipfile.ZIP_DEFLATED) as archive:
archive.write(full, os.path.relpath(full, src))
PY
cat > "$OUT/README.md" <<'MD'
cat > "$OUT/README.md" <<MD
# Tab Park build
`tabpark/` is the unpacked extension. Load it with
\`tabpark/\` is the unpacked extension. Load it with
about:debugging#/runtime/this-firefox > Load Temporary Add-on > pick
`tabpark/manifest.json`.
\`tabpark/manifest.json\`.
`tabpark.xpi` is the same files zipped, for handing to someone else or
uploading to addons.mozilla.org.
\`tabpark-$VERSION-unsigned.xpi\` is the same files zipped, for uploading to
addons.mozilla.org. It is unsigned; AMO signs it as part of submission.
MD
echo "built $DEST and $OUT/tabpark.xpi"
echo "built $DEST and $XPI"