使用web-ext sign添加发布说明失败,求解决方案
问题描述
我使用web-ext sign上传并签名Firefox插件,希望通过命令行添加发布说明以避免后续手动操作。于是用--use-submission-api和--amo-metadata参数指定了如下元数据文件:
{ "release_notes": { "en-US": " Changed\n\n- Upgrade dependencies: Typescript 4.9.5, web-ext 7.5.0, etc.\n- Add images to ReadMe\n\n Fixed\n\n- Options page width (#197)\n", "_default": "en-US" } }
但生成版本的发布说明仍为空,请问是否可以通过web-ext sign添加发布说明?以下是完整签名过程的日志:
2023-03-18T05:03:45.4465397Z $ /home/runner/work/new-tab-moment/new-tab-moment/node_modules/.bin/web-ext sign --api-key *** --api-secret *** --use-submission-api --channel=listed --source-dir build --amo-metadata ./version-metadata.json 2023-03-18T05:03:45.8436859Z Applying config file: ./package.json 2023-03-18T05:03:46.2628891Z Building web extension from /home/runner/work/new-tab-moment/new-tab-moment/build 2023-03-18T05:03:46.5185667Z Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/ 2023-03-18T05:03:47.9481368Z Waiting for Validation... 2023-03-18T05:03:47.9492462Z Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/64277bfc0b79418fb679ee2d529aff7f/ [same fetching URL skipped] 2023-03-18T05:03:55.9974791Z Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/64277bfc0b79418fb679ee2d529aff7f/ 2023-03-18T05:03:56.3229850Z Validation results: { 2023-03-18T05:03:56.3234193Z errors: 0, 2023-03-18T05:03:56.3235194Z warnings: 1, 2023-03-18T05:03:56.3235980Z notices: 0, 2023-03-18T05:03:56.3236478Z success: true, 2023-03-18T05:03:56.3237286Z compatibility_summary: { warnings: 0, errors: 0, notices: 0 }, 2023-03-18T05:03:56.3237924Z metadata: { 2023-03-18T05:03:56.3238437Z listed: true, 2023-03-18T05:03:56.3238966Z identified_files: {}, 2023-03-18T05:03:56.3239999Z id: 'new-tab-moment@laedit.net', 2023-03-18T05:03:56.3240606Z manifestVersion: 3, 2023-03-18T05:03:56.3241258Z name: 'New Tab - Moment', 2023-03-18T05:03:56.3241775Z type: 1, 2023-03-18T05:03:56.3242359Z version: '0.9.7', 2023-03-18T05:03:56.3243056Z firefoxMinVersion: '109.0', 2023-03-18T05:03:56.3243652Z experimentApiPaths: {}, 2023-03-18T05:03:56.3244317Z totalScannedFileSize: 32805, 2023-03-18T05:03:56.3244888Z emptyFiles: [], 2023-03-18T05:03:56.3245581Z jsLibs: {}, 2023-03-18T05:03:56.3246131Z unknownMinifiedFiles: [] 2023-03-18T05:03:56.3246673Z }, 2023-03-18T05:03:56.3247135Z messages: [ 2023-03-18T05:03:56.3247586Z { 2023-03-18T05:03:56.3248024Z tier: 1, 2023-03-18T05:03:56.3248604Z type: 'warning', 2023-03-18T05:03:56.3249103Z id: [Array], 2023-03-18T05:03:56.3249905Z message: 'Manifest V3 compatibility warning', 2023-03-18T05:03:56.3250532Z description: [Array], 2023-03-18T05:03:56.3251168Z compatibility_type: null, 2023-03-18T05:03:56.3251704Z extra: true 2023-03-18T05:03:56.3252163Z } 2023-03-18T05:03:56.3252586Z ], 2023-03-18T05:03:56.3253042Z message_tree: {}, 2023-03-18T05:03:56.3253539Z ending_tier: 5 2023-03-18T05:03:56.3254050Z } 2023-03-18T05:03:56.3258343Z Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/new-tab-moment@laedit.net/ 2023-03-18T05:03:57.3477619Z Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/new-tab-moment@laedit.net/versions/?filter=all_with_unlisted 2023-03-18T05:03:57.6142456Z Waiting for Approval... 2023-03-18T05:03:57.6149533Z Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/new-tab-moment@laedit.net/versions/5540970/ [same fetching URL skipped] 2023-03-18T05:05:28.6037320Z Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/new-tab-moment@laedit.net/versions/5540970/ 2023-03-18T05:05:28.7497326Z Fetching URL: https://addons.mozilla.org/firefox/downloads/file/4085313/new_tab_moment-0.9.7.xpi 2023-03-18T05:05:28.9317301Z Done in 103.53s.
解决方案
可以通过web-ext sign添加发布说明,问题出在元数据文件的格式上——发布说明属于版本级元数据,需要嵌套在version字段内,直接放在顶层会被忽略。
修改后的元数据文件应为:
{ "version": { "release_notes": { "en-US": " Changed\n\n- Upgrade dependencies: Typescript 4.9.5, web-ext 7.5.0, etc.\n- Add images to ReadMe\n\n Fixed\n\n- Options page width (#197)\n", "_default": "en-US" } } }
额外确认两点:
- 确保使用的
web-ext版本为7.x及以上,该版本才稳定支持此功能 - 确认API密钥拥有修改版本元数据的权限
使用修改后的元数据文件重新执行web-ext sign命令,发布说明就会被正确添加到新版本中。
内容的提问来源于stack exchange,提问作者Jérémie Bertrand
相关产品推荐
相关产品推荐

