How to automate publishing Chrome extension to the Web store?

末鹿安然 提交于 2019-12-02 16:48:21

Since March 2014, there is an API to do that. Documentation here.

I never worked with it, so I cannot provide a full example.

However, from the documentation, the basic flow would be an authenticated request with an updated package, followed by an authenticated request to publish:

> curl \
-H "Authorization: Bearer $TOKEN"  \
-H "x-goog-api-version: 2" \
-X PUT \
-T $FILE_NAME \
-v \
https://www.googleapis.com/upload/chromewebstore/v1.1/items/$APP_ID

> curl \
-H "Authorization: Bearer $TOKEN"  \
-H "x-goog-api-version: 2" \
-H "Content-Length: 0" \
-X POST \
-v \
https://www.googleapis.com/chromewebstore/v1.1/items/$APP_ID/publish
Anton

Here is my grunt plugin for this https://github.com/c301/grunt-webstore-upload.

But you still have to upload your extension first time, in order to get the extension id.

It solves only the uploading problem, you need to compile the ZIP file first. You can use this grunt plugin https://github.com/oncletom/grunt-crx ( I didn't test it ).

Actually, you cannot do it because of security issue. But you can build your extension to zip file automatically, then you just upload that zip file to Google Web Store. That's all!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!