Links

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.
forge.config.js
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:
  • PREFIX is the value of the config.folder option (defaults to your package.json version).
  • NAME is the file name of the artifact you are publishing.
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.
forge.config.js
{
name: '@electron-forge/publisher-s3',
config: {
// ...
keyResolver: (fileName: string, platform: string, arch: string) => {
return `some-prefix/${platform}/${arch}/filename`;
}
// ...
}
}
Last modified 2mo ago