Skip to content

Commit

Permalink
extension: some updates for publishing + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed May 26, 2024
1 parent 2f78cae commit 9daca10
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
17 changes: 17 additions & 0 deletions doc/DEVELOPMENT.org
Original file line number Diff line number Diff line change
@@ -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
9 changes: 5 additions & 4 deletions extension/build
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,26 @@ 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:
assert args.lint
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?
Expand Down
3 changes: 2 additions & 1 deletion extension/generate_manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = {
Expand Down
2 changes: 1 addition & 1 deletion extension/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9daca10

Please sign in to comment.