Giter VIP home page Giter VIP logo

semantic-release-firefox's Introduction

semantic-release-firefox

npm version build status codecov dependencies peerDependencies code style: prettier semantic-release

A semantic-release plugin for you to be able to easily publish Firefox Extensions using it's automated release. Will update the version in the manifest, create a .xpi, zip your sources and submit everything for review, including semantic release notes.

Since Mozilla does not expose an API to do fully automated extension releases, runs a headless Chrome through Puppeteer to upload the files through the web form.

Plugins

verifyConditions

Verify the presence of the authentication (set via environment variables).

prepare

Write the correct version to the manifest.json and creates a xpi file of the whole dist folder.

  • xpiPath: Required, the filename of the xpi file.
  • distFolder: Required, the folder that will be zipped.
  • manifestPath: Optional, the path of the manifest inside the dist folder. Defaults to ${distFolder}/manifest.json.
  • sourcesGlob: Optional, a glob pattern of source files that will be zipped and submitted for review. Defaults to all files in the cwd (**)
  • sourcesGlobOptions: Optional, glob options passed to node-glob. Defaults to ignore node_modules, distFolder, xpiPath and sourcesArchivePath. You can use this for example if
    • you need to include dotfiles (set { dot: true })
    • if you need to include certain private packages from node_modules (set ignore: 'node_modules/!(privatepkg|privatepkg2)/**'). Make sure to still exclude sourcesArchivePath or the plugin may get stuck in an infinite loop trying to add the archive to itself!
  • sourcesArchivePath: Optional, the file path for the zip with the source files that will be created. Defaults to ./sources.zip. Set this to null to not create a sources archive.

publish

Uploads the generated xpi file, a zip of the sources and submits it together with release notes.

  • xpiPath: Required, the filename of the xpi file.
  • addOnSlug: Required, The URL slug of the extension, as in https://addons.mozilla.org/en-US/firefox/addon/SLUG/
  • sourcesArchivePath: Optional, the file path for the zip with the source code that will be uploaded. Defaults to ./sources.zip. Set this to null to not upload a sources archive.
  • notesToReviewer: Optional, notes to the reviewer that will be submitted for every version. For example, you could link to the source code on GitHub.

Configuration

Mozilla Add-On hub authentication

The following environment variables have to be made available in your CI environment: FIREFOX_EMAIL, FIREFOX_PASSWORD and FIREFOX_TOTP_SECRET. It is recommended to create a bot account for them.

The account must have 2FA set up, with the 2FA secret saved in FIREFOX_TOTP_SECRET. Click on "Can't scan code?" when being shown the setup QR code to reveal the TOTP secret in plain text.

Make sure the account accepted the terms & agreements by visiting the submit page once (otherwise the release will fail).

Release configs

Use semantic-release-chrome as part of verifyConditions, prepare and publish.

A basic config file example is available below:

{
  "verifyConditions": ["semantic-release-firefox", "@semantic-release/github"],
  "prepare": [
    {
      "path": "semantic-release-firefox",
      "xpiPath": "my-extension.xpi",
      "distFolder": "dist"
    }
  ],
  "publish": [
    {
      "path": "semantic-release-firefox",
      "xpiPath": "my-extension.xpi",
      "addOnSlug": "my-extension"
    },
    {
      "path": "@semantic-release/github",
      "assets": [
        {
          "path": "my-extension.xpi"
        }
      ]
    }
  ]
}

Development

Tests for the publish plugin are running against a mock AMO server written with Express. Run them with npm test.

semantic-release-firefox's People

Contributors

exkazuu avatar felixfbecker avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

exkazuu

semantic-release-firefox's Issues

Fails Due to Additional Redirect

Hi @felixfbecker!

I'm attempting to use this plugin to publish an extension, and it looks like an additional redirect in-between .../submit and /oauth/signin is tripping up the login logic during publish. It looks to me that the submit page redirects to /authorization and then /oauth/signin when no user is logged in now.

Repo Issue Was Found In
Travis Job

Plugins fails to verify

Hello,

When trying to use this semantic-release plugin I get this error:

[23:32:45] [semantic-release] โ€บ โœ– An error occurred while running semantic-release: { Error: Environment variables FIREFOX_EMAIL and FIREFOX_PASSWORD must be set
at Object.exports.verifyFirefoxConditions ...

Both environment variables are set. Seeing the other existing issue I think these might be related.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

File: renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: Unsafe regExp for packageRules[0].packagePatterns: ^@types/

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm @types/marked Unavailable
npm @types/pretty-bytes Unavailable
npm @types/puppeteer Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency @types/marked-terminal to v3.1.7
  • chore(deps): update dependency @types/morgan to v1.9.9
  • chore(deps): update dependency @types/mz to v2.7.8
  • chore(deps): update dependency @types/puppeteer to v5.4.7
  • chore(deps): update dependency @types/rmfr to v2.0.5
  • chore(deps): update dependency @types/node to v14.18.63
  • chore(deps): update dependency @types/pretty-bytes to v5.2.0
  • fix(deps): update dependency marked to ^0.8.0
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update actions/setup-node action to v4
  • chore(deps): update dependency @types/archiver to v6
  • chore(deps): update dependency @types/glob to v8
  • chore(deps): update dependency @types/marked to v6
  • chore(deps): update dependency @types/marked-terminal to v6
  • chore(deps): update dependency @types/node to v20
  • chore(deps): update dependency @types/puppeteer to v7
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency formidable to v3 (formidable, @types/formidable)
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency mocha to v10 (mocha, @types/mocha)
  • chore(deps): update dependency nyc to v17
  • chore(deps): update dependency prettier to v3
  • chore(deps): update dependency typescript to v5
  • fix(deps): update dependency aggregate-error to v5
  • fix(deps): update dependency archiver to v7
  • fix(deps): update dependency delay to v6
  • fix(deps): update dependency marked to v13
  • fix(deps): update dependency marked-terminal to v7
  • fix(deps): update dependency p-retry to v6
  • fix(deps): update dependency pretty-bytes to v6
  • fix(deps): update dependency puppeteer to v22
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Other Branches

These updates are pending. To force PRs open, click the checkbox below.

  • chore(deps): update dependency decompress to v4.2.1 [security]
  • chore(deps): update dependency morgan to v1.9.1 [security]
  • chore(deps): update dependency express to v4.19.2 [security]

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v2
  • actions/setup-node v2
npm
package.json
  • aggregate-error ^1.0.0
  • archiver ^2.1.1
  • delay ^5.0.0
  • marked ^0.7.0
  • marked-terminal ^3.1.1
  • mz ^2.7.0
  • otplib ^12.0.1
  • p-retry ^4.5.0
  • pretty-bytes ^5.1.0
  • puppeteer ^5.5.0
  • upndown ^2.1.0
  • @commitlint/cli ^7.0.0
  • @commitlint/config-conventional ^7.0.1
  • @sourcegraph/eslint-config ^0.25.0
  • @types/archiver 2.1.3
  • @types/cookie-parser 1.4.2
  • @types/decompress 4.2.4
  • @types/express 4.16.1
  • @types/formidable 1.0.31
  • @types/glob 7.2.0
  • @types/marked 3.0.3
  • @types/marked-terminal 3.1.3
  • @types/mocha 8.2.3
  • @types/morgan 1.9.3
  • @types/mz 2.7.4
  • @types/node 14.17.34
  • @types/pretty-bytes 5.1.0
  • @types/puppeteer 5.4.4
  • @types/rmfr 2.0.1
  • async-middleware ^1.2.1
  • body-parser ^1.18.3
  • cookie-parser ^1.4.3
  • decompress ^4.2.0
  • eslint ^7.27.0
  • express ^4.16.3
  • formidable ^1.2.1
  • husky ^0.14.3
  • mocha ^8.0.0
  • morgan ^1.9.0
  • nyc ^13.0.0
  • prettier ^2.0.0
  • rmfr ^2.0.0
  • semantic-release 17.3.0
  • ts-node ^7.0.0
  • typescript ^4.2.4
  • semantic-release ^17.3.0
  • node >=14.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.