discoveryjs / browser-extension-json-discovery

A browser extension (Chrome, Edge, Firefox) that changes the way you're viewing JSON
305 stars 11 forks source link

Add deploy to web stores Github Action #76

Closed ColdSauce closed 2 years ago

ColdSauce commented 2 years ago

Hiya! We created a Github action to make it easier to publish extensions to the various web stores.

Thought you might find it useful so I added a Github workflow that will build the extension, zip it up, and publish to the web stores on dispatch.

The only thing you would need to create is a SUBMIT_KEYS GitHub repository secret.

This secret is a JSON, with the schema defined here.

Here's a sample json blob with the proper zip file location already pre-filled (the {version} in the zip file name will automatically be substituted for whatever version's in the package.json) :

{
  "$schema": "https://raw.githubusercontent.com/plasmo-corp/bpp/v1/keys.schema.json",
  "chrome": {
    "zip": "build-chrome/jsondiscovery-chrome-{version}.zip",
    "clientId": "123",
    "clientSecret": "456",
    "refreshToken": "789",
    "extId": "abcd"
  },
  "firefox": {
    "zip": "build-firefox/jsondiscovery-firefox-{version}.zip",
    "apiKey": "123",
    "apiSecret": "abcd",
    "extId": "foobar"
  }
}

You can find instructions on how to get those keys in the schema, or if you use vscode, the schema should provide hint/intelisense when hovering over the json properties. If you need any help in setting up the keys, feel free to @ me.

Otherwise, if this doesn't seem necessary, feel free to close the PR!

(p.s. I also fixed an issue where the build script would fail if the build-* directories weren't present on the file system by adding a little check to that code)

exdis commented 2 years ago

Hey @ColdSauce! Thanks for the pull request and for finding that directory removal bug 👍. I prefer to keep things under control, so I think I'll continue deploying this extension manually for now, but I'll keep your github-action on my radar, and maybe we'll use it later.