Electron Forge
  • Getting Started
  • Importing an Existing Project
  • CLI
  • Core Concepts
    • Why Electron Forge?
    • Build Lifecycle
  • Configuration
    • Configuration Overview
    • TypeScript Setup
    • Plugins
      • Webpack Plugin
      • Vite Plugin
      • Electronegativity Plugin
      • Auto Unpack Native Modules Plugin
      • Local Electron Plugin
      • Fuses Plugin
    • Makers
      • AppX
      • deb
      • DMG
      • Flatpak
      • pkg
      • RPM
      • Snapcraft
      • Squirrel.Windows
      • WiX MSI
      • ZIP
    • Publishers
      • Bitbucket
      • Electron Release Server
      • GitHub
      • Google Cloud Storage
      • Nucleus
      • S3
      • Snapcraft
    • Hooks
  • Built-in Templates
    • Webpack
    • Webpack + Typescript
    • Vite
    • Vite + TypeScript
  • Guides
    • Code Signing
      • Signing a Windows app
      • Signing a macOS app
    • Custom App Icons
    • Framework Integration
      • React
      • React with TypeScript
      • Vue 3
    • Developing with WSL
  • Advanced
    • Auto Update
    • Debugging
    • Extending Electron Forge
      • Writing Plugins
      • Writing Templates
      • Writing Makers
      • Writing Publishers
    • API Docs
Powered by GitBook
On this page
  • Installation
  • Usage
  • Output location
  • Authentication

Was this helpful?

Edit on GitHub
  1. Configuration
  2. Publishers

Google Cloud Storage

Publishing your Electron app artifacts to a Google Cloud Storage bucket.

PreviousGitHubNextNucleus

Last updated 11 months ago

Was this helpful?

This Publisher was added in Electron Forge v7.1.0.

The Google Cloud Storage target publishes all your artifacts to a .

Installation

npm install --save-dev @electron-forge/publisher-gcs

Usage

To use @electron-forge/publisher-gcs, add it to the publishers array in your :

forge.config.js
module.exports = {
  // ...
  publishers: [
    {
      name: '@electron-forge/publisher-gcs',
      config: {
        storageOptions: {
          // add additional Storage constructor parameters here
          projectId: 'my-project-id'
        },
        bucket: 'my-bucket',
        folder: 'custom-folder-name',
        public: true
      }
    }
  ]
};

Output location

When executed, the Publisher will publish to your GCS bucket under the following key:

${config.folder || version}/${artifactName}

If you run publish twice with the same version on the same platform, it is possible for your old artifacts to get overwritten in Storage. It is your responsibility to ensure that you don't overwrite your own releases.

Authentication

Under the hood, the Google Cloud Storage Publisher uses the @google-cloud/storage SDK and its associated authentication options.

Additional configuration options are documented in .

To pass options into the Google Cloud Storage SDK's , use the config.storageOptions parameter.

We recommend following to get authentication configured.

Google Cloud Storage bucket
Forge configuration
PublisherGCSConfig
Storage constructor
Google's authentication documentation for client libraries