From 9daca10f6ceb1801bc6a821ae678e94ac5f2065a Mon Sep 17 00:00:00 2001 From: karlicoss Date: Fri, 24 May 2024 22:47:54 +0100 Subject: [PATCH] extension: some updates for publishing + docs --- doc/DEVELOPMENT.org | 17 +++++++++++++++++ extension/build | 9 +++++---- extension/generate_manifest.js | 3 ++- extension/rollup.config.js | 2 +- 4 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 doc/DEVELOPMENT.org diff --git a/doc/DEVELOPMENT.org b/doc/DEVELOPMENT.org new file mode 100644 index 0000000..18304d8 --- /dev/null +++ b/doc/DEVELOPMENT.org @@ -0,0 +1,17 @@ +* Releasing extension +** AMO (addons.mozilla.org) +: cd extension +: npm install # (if necessary) +: ./build --firefox --v2 --lint --release --publish + +Note that this command will go in a busy loop waiting for the extension to be approved on AMO. +(you will see it on https://addons.mozilla.org/en-US/developers/addon/grasp/versions) + +- for now =v2= version of manifest is used with Firefox +- you can use =--publish=unlisted= if you want to test extension yourself first + + +Currently seems like it's not possible to upload the source code and notes for reviewers automatically: + +- https://github.com/mozilla/web-ext/issues/3137 +- https://github.com/mozilla/addons/issues/6158 diff --git a/extension/build b/extension/build index 0dfc2fa..020632e 100755 --- a/extension/build +++ b/extension/build @@ -85,13 +85,13 @@ def main() -> None: if args.release: assert args.lint # TODO not sure.. - def firefox_release_args(): + def firefox_publish_args(): from firefox_dev_secrets import API_KEY, API_SECRET return [ '--artifacts-dir', str(artifacts_dir), '--api-key' , API_KEY, '--api-secret' , API_SECRET, - '--id' , IDS[target], + # seems like webext sign requires addon id to be in manifest now ] if args.publish is not None: @@ -99,11 +99,12 @@ def main() -> None: assert args.release if 'firefox' in target: check_call([ - npm, 'run', 'release:amo', + npm, 'run', 'web-ext', '--', + 'sign', '--use-submission-api', '--channel', args.publish, '--source-dir', str(ext_dir), - *firefox_release_args(), + *firefox_publish_args(), ]) elif target == 'chrome': assert args.publish == 'listed' # no notion of unlisted on chrome store? diff --git a/extension/generate_manifest.js b/extension/generate_manifest.js index ae2d0ea..4442816 100644 --- a/extension/generate_manifest.js +++ b/extension/generate_manifest.js @@ -167,7 +167,8 @@ export function generateManifest({ manifest.optional_permissions.push(...optional_host_permissions) } - if (v3) { + if (target === T.FIREFOX || v3) { + // for firefox, this is required during publishing? // this isn't really required in chrome, but without it, webext lint fails for chrome addon const gecko_id = target === T.FIREFOX ? ext_id : '{00000000-0000-0000-0000-000000000000}' manifest['browser_specific_settings'] = { diff --git a/extension/rollup.config.js b/extension/rollup.config.js index c5a8a0f..e46b2b6 100644 --- a/extension/rollup.config.js +++ b/extension/rollup.config.js @@ -56,7 +56,7 @@ function generateManifestPlugin() { const manifest = generateManifest({ target: target, version: manifest_version, - releas: release, + release: release, ext_id: ext_id, }) const mjs = JSON.stringify(manifest, null, 2)