electron-builder Google Cloud Storage bucket publisher (because GCS's S3-compat API doesn't support the S3 publisher)
Heavily inspired by @zalewskip123's electron-publisher-simple-http
Install electron-publisher-gcs through your package manager (yarn, npm, pnpm, etc...)
Next, set your publish provider to gcs.
Add a new root object publish-gcs to your package.json. (see publish-gcs object)
{
"bucket": "releases.cool.app",
"path": "/${name}/${os}/${arch}/${filename}",
"serviceAccount": "D:\\cool-app\\secrets\\service-account.json",
"public": true,
"resumable": true
}Type: string
The Google Cloud Storage bucket name
Examples:
releases.cool.app
cool-app-releases
Both can be accessible from {bucket_name}.storage.googleapis.com.
Type: string
Default: /${name}/${os}/${arch}/${filename}
name: the app's name (from electron-builder)os:task.packager.platform.namearch: Architecturefilename: The filename of the file being uploaded
Example:
/${name}/${os}/${arch}/${filename}
Type: string or object
Path to a service account JSON file or an object containing the JSON content as an object
Examples:
D:\\cool-app\\secrets\\service-account.json
{
"type": "service_account",
"project_id": "cool-app-xxxxxx",
"private_key_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"private_key": "-----BEGIN PRIVATE KEY-----\nxxxxxxxxxxx\n-----END PRIVATE KEY-----\n",
"client_email": "service-account@cool-app-xxxxxx.iam.gserviceaccount.com",
"client_id": "xxxxxx",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/service-account%40cool-app-xxxxxx.iam.gserviceaccount.com"
}Type: boolean
Default: true
See Bucket#upload (options.public)
Type: boolean
Default: true
See Bucket#upload (options.resumable)