JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14
  • Score
    100M100P100Q51045F
  • License MIT

A semantic-release plugin to publish Firefox add-ons to AMO (addons.mozilla.org).

Package Exports

  • semantic-release-amo
  • semantic-release-amo/update-addon

Readme

semantic-release-amo

A semantic-release plugin to publish Firefox add-ons to AMO (addons.mozilla.org).

Motivation

semantic-release-firefox-add-on is a great plugin to publish Firefox add-ons to AMO. However, it does not support submitting source code.

This plugin makes it possible to submit source code by using API V5.

Usage

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "semantic-release-amo",
      {
        "addonId": "my-addon-id",
        "addonDirPath": "dist",
        "approvalNotes": "To build this add-on, please run `yarn && yarn build`",
        "submitSource": true
      }
    ]
  ]
}

Steps

Step Description
verifyConditions Verify the environment variables and the options.
prepare Update manifest.json and archive the add-on.
publish Publish the add-on to AMO.

Environment variables

Variable Description
AMO_API_KEY REQUIRED The API key to publish the add-on to AMO.
AMO_API_SECRET REQUIRED The API secret to publish the add-on to AMO.
AMO_BASE_URL The API base URL. Defaults to https://addons.mozilla.org/api/v5/addons/.

Options

Option Description
addonId REQUIRED The id of the add-on. Can be either a slug or a GUID.
addonDirPath REQUIRED The path of the directory containing the add-on.
addonZipPath The path of the zip file to archive the add-on. Defaults to "./sematic-release-amo/${nextRelease.version}.zip".
channel The channel to publish the add-on. Can be either "listed" or "unlisted". Defaults to "listed".
approvalNotes The notes for the Mozilla reviewers.
compatibility The applications that the add-on is compatible with. Can be an array of "firefox" or "android". Defaults to ["firefox"].
submitReleaseNotes Whether to submit the release notes typically generated by @semantic-release/release-notes-generator. Defaults to false.
submitSource Whether to submit the source code archived by git archive. Defaults to false.

Exported function

updateAddon

// Make sure that the `moduleResolution` field in tsconfig.json is set to 'Node16' or 'NodeNext'.
import { updateAddon } from 'semantic-release-amo/update-addon';

await updateAddon({
  apiKey: '...',
  apiSecret: '...',
  baseURL: 'https://addons.mozilla.org/api/v5/addons/', // optional, defaults to 'https://addons.mozilla.org/api/v5/addons/'
  addonId: '...',
  addonZipPath: await generateAddonZip(),
  channel: 'listed', // optional, defaults to 'listed'
  approvalNotes: '...', // optional
  compatibility: ['firefox'], // optional, defaults to ['firefox']
  releaseNotes: '...', // optional
  sourceZipPath: await generateSourceZip(), // optional
  logger: console, // optional, defaults to console
});

Author

iorate (Twitter)

License

semantic-release-amo is licensed under MIT License.