Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added automatic publishing #76

Open
wants to merge 1 commit into
base: react-typescript
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
- ES6 modules support
- React UI Library by default
- Smart reload
- Automatic Publishing

## Browser Support

Expand Down Expand Up @@ -130,6 +131,25 @@ Note: By default the `manifest.json` is set with version `0.0.0`. The webpack lo

If you don't want to use `package.json` version, you can disable the option [here](https://github.com/abhijithvijayan/web-extension-starter/blob/e10158c4a49948dea9fdca06592876d9ca04e028/webpack.config.js#L79).

### Automatic Publishing

- To publish your extention automatically, you first have to set some enviroment variables.

- ### Chrome

- Set `EXTENSION_ID` as the Chrome Extention ID.
- Set `CLIENT_ID` as the Chrome Dev Client ID.
- Set `CLIENT_SECRET` as the Chrome Dev Client Secret (If Needed).
- Set `REFRESH_TOKEN` as the Chrome Dev Client Refresh Token.
- You can find how to get your Client ID and Refresh Token [here](https://github.com/fregante/chrome-webstore-upload/blob/main/How%20to%20generate%20Google%20API%20keys.md).

- ### Firefox

- Set `WEB_EXT_API_KEY` as the Firefox Web Extention API Key.
- Set `WEB_EXT_API_SECRET` as the Firefox Web Extention API Secret.

- Now you can publish your application through either `yarn run publish:chrome` for Chrome or `yarn run publish:firefox` for Firefox (or `yarn run publish` for both)!

### Generating browser specific manifest.json

Update `source/manifest.json` file with browser vendor prefixed manifest keys
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"build:firefox": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=firefox webpack",
"build:opera": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=opera webpack",
"build": "yarn run build:chrome && yarn run build:firefox && yarn run build:opera",
"publish:chrome": "yarn run build:chrome && cd chrome-webstore-upload upload --source extention/chrome.zip --auto-publish",
"publish:firefox": "yarn run build:firefox && cd ./extension/firefox && web-ext-submit",
"publish": "yarn run publish:chrome && yarn run publish:firefox",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix"
},
Expand Down Expand Up @@ -54,6 +57,7 @@
"@typescript-eslint/parser": "^4.4.1",
"autoprefixer": "^10.2.5",
"babel-loader": "^8.2.2",
"chrome-webstore-upload-cli": "^2.0.1",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^6.4.1",
"cross-env": "^7.0.3",
Expand All @@ -79,6 +83,7 @@
"sass-loader": "^10.2.0",
"terser-webpack-plugin": "^4.2.3",
"typescript": "4.1.5",
"web-ext-submit": "^6.4.0",
"webpack": "^4.46.0",
"webpack-cli": "^4.7.0",
"webpack-extension-reloader": "^1.1.4",
Expand Down
Loading