S3

How to publish your distributable Electron app artifacts to Amazon S3

The S3 target publishes your Make artifacts to an Amazon S3 bucket.

Authentication

It is recommended to follow the Amazon AWS guide and set either a shared credentials guide or the proper environment variables. However, if that is not possible, the publisher config allows the setting of the accessKeyId and secretAccessKey configuration options.

Usage

Configuration options are documented in PublisherS3Config.

module.exports = {
  // ...
  publishers: [
    {
      name: '@electron-forge/publisher-s3',
      config: {
        bucket: 'my-bucket',
        public: true
      }
    }
  ]
};

Key management

By default, the S3 publisher will upload its objects to thePREFIX/NAME key, where:

If you run the Publish command multiple times on the same platform for the same version (e.g. simultaneously publishing ia32 and x64 Windows artifacts), your uploads can get overwritten in the S3 bucket.

To avoid this problem, you can use the keyResolver option to generate the S3 key programmatically.

{
  name: '@electron-forge/publisher-s3',
  config: {
    // ...
    keyResolver: (fileName, platform, arch) => {
      return `some-prefix/${platform}/${arch}/filename`
    }
    // ...
  }
}