You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,10 @@ This package export the following plugins:
40
40
41
41
Verify the presence of the authentication parameters, which are set via environment variables (see [Chrome webstore authentication][chrome-authentication]).
42
42
43
+
#### `verifyConditions` parameters
44
+
45
+
-`extensionId`: **REQUIRED** parameter. The `extension id` from the webstore. For example: If the url of your extension is [https://chrome.google.com/webstore/detail/webplayer-hotkeys-shortcu/ikmkicnmahfdilneilgibeppbnolgkaf](https://chrome.google.com/webstore/detail/webplayer-hotkeys-shortcu/ikmkicnmahfdilneilgibeppbnolgkaf), then the last portion, `ikmkicnmahfdilneilgibeppbnolgkaf`, will be the `extension id`. You can also take this ID on the [developers dashboard](https://chrome.google.com/webstore/developer/dashboard), under the name `Item ID` located inside the `More info` dialog. This is used so that we can confirm that the credentials are working for the extension you are trying to publish.
46
+
43
47
### `prepare`
44
48
45
49
Writes the correct version to the `manifest.json` and creates a `zip` file with everything inside the `dist` folder.
@@ -58,14 +62,13 @@ This plugin requires some parameters to be set, so be sure to check below and fi
58
62
59
63
Uploads the generated zip file to the webstore and publishes a new release.
60
64
65
+
Unfortunately, due to Google's restrictions, this plugin can only publish extensions that already exists on the store, so you will have to at least make a draft release for yourself, so the plugin can create a proper release for the first time. You can create a draft release with just a minimum `manifest.json` with version `0.0.1` compressed in a zip file.
66
+
If you decide to make the draft, make sure to fill all the required fields on the drafts page, otherwise the publish will fail with a `400` status code (Bad request).
67
+
61
68
#### `publish` parameters
62
69
63
70
-`extensionId`: **REQUIRED** parameter. The `extension id` from the webstore. For example: If the url of your extension is [https://chrome.google.com/webstore/detail/webplayer-hotkeys-shortcu/ikmkicnmahfdilneilgibeppbnolgkaf](https://chrome.google.com/webstore/detail/webplayer-hotkeys-shortcu/ikmkicnmahfdilneilgibeppbnolgkaf), then the last portion, `ikmkicnmahfdilneilgibeppbnolgkaf`, will be the `extension id`. You can also take this ID on the [developers dashboard](https://chrome.google.com/webstore/developer/dashboard), under the name `Item ID` located inside the `More info` dialog.
64
71
65
-
Unfortunately, due to Google's restrictions, this plugin can only publish extensions that already exists on the store, so you will have to at least make a draft release for yourself, so the plugin can create a proper release for the first time. You can create a draft release with just a minimum `manifest.json` with version `0.0.1` compressed in a zip file.
66
-
67
-
If you decide to make the draft, make sure to fill all the required fields on the drafts page, otherwise the publishing will fail with a `400` status code (Bad request).
68
-
69
72
-`asset`: **REQUIRED** parameter. The zip file that will be published to the chrome webstore.
70
73
71
74
-`target`: Valid options are:
@@ -85,7 +88,13 @@ A basic configuration file example is available below:
Unfortunately we can't tell for sure what's the reason for that, but usually this happens when there's something wrong or missing with the configs.
53
+
Make sure to check:
54
+
55
+
* The extensionId is correctly set on the plugin config
56
+
* The environment variables GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, and GOOGLE_REFRESH_TOKEN are correctly set (Double check the authentication guide: https://github.com/GabrielDuarteM/semantic-release-chrome/blob/master/Authentication.md)
57
+
* Go to https://chrome.google.com/webstore/devconsole, click on the extension you are publishing, and verify that there's no errors there (for example, on the "Why can't I submit" button modal, or on any of the other tabs there)
58
+
59
+
`
60
+
letuploadRes
61
+
62
+
logger.log('Uploading zip file to Google Web Store...')
63
+
try{
64
+
uploadRes=awaitwebStore.uploadExisting(zipFile)
65
+
}catch(err){
66
+
thrownewSemanticReleaseError(
67
+
`Error uploading extension to Google Web Store. ${errorMessage} Error details:\n\n${err}`,
68
+
errasstring,
69
+
)
70
+
}
71
+
72
+
constAggregateError=(awaitgetEsModule(
73
+
'aggregate-error',
74
+
))astypeofimport('aggregate-error')['default']
57
75
58
-
if(uploadRes.uploadState==='FAILURE'){
76
+
if(uploadRes?.uploadState==='FAILURE'){
59
77
consterrors: SemanticReleaseError[]=[]
78
+
60
79
uploadRes.itemError.forEach((err: any)=>{
61
80
constsemanticError=newSemanticReleaseError(
62
81
err.error_detail,
63
82
err.error_code,
64
83
)
84
+
65
85
errors.push(semanticError)
66
86
})
67
-
thrownewAggregateError(errors).errors
87
+
88
+
thrownewAggregateError(errors)
68
89
}
69
90
91
+
logger.log(`Successfully uploaded extension to Google Web Store`)
0 commit comments