Publish browser extension automatically
It is my first try to using CircleCI. Instead of using TravisCI because I hope it can execute some tasks in parallel and execute some tasks after a task success but the TravisCI cannot achieve it.
The following workflow is the final result.
We need two command line tool: chrome-webstore-upload-cli and web-ext.
The chrome-webstore-upload-cli could help you publish the extension to the google chrome extension store. It is based on chrome-webstore-upload which is a tool like chrome-webstore-manager. Its author made an easy to use cli tool to make user could publish their extension without any extra code. And you just need to set some environment varible (CLIENT_ID, CLIENT_SECRET and REFRESH_TOKEN). The author of this tool also made a tutorial humanly to tell you how to generate Google API keys.
For publishing to firefox addons you can use web-ext. Actually it is a fork of web-ext. You can learn it from the author of it left the comment under a issue of web-ext. It is available indeed. You just need to generate an API key from here. Except it you also need give the id of your extension, otherwise it will become a new item in the firefox addons.
It is the UUID in the following image. You can find it in detail of the addon page.
After you got all of above things, you can put following code to your CircleCI config file.
At last, put the job to the workflow and set the requirement of them as
build job are all things you need to do. If you hope the publish job only executed when the commit with a tag you can configure it like following code.
I hope to download a .crx file from chrome extension store and upload it to release page to help someone cannot visit google service get it so I add a job
publish_chrome. It use ghr to manage github release page.
The whole config file is here.