description |
---|
How to publish your distributable Electron app artifacts to Amazon S3 |
The S3 target publishes your Make artifacts to an Amazon S3 bucket.
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.
Configuration options are documented in PublisherS3Config
.
{% code title="forge.config.js" %}
module.exports = {
// ...
publishers: [
{
name: '@electron-forge/publisher-s3',
config: {
bucket: 'my-bucket',
public: true
}
}
]
}
{% endcode %}
By default, the S3 publisher will upload its objects to thePREFIX/NAME
key, where:
PREFIX
is the value of theconfig.folder
option (defaults to your package.json version).NAME
is the file name of the artifact you are publishing.
{% hint style="warning" %}
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.
{% code title="forge.config.js" %}
{
name: '@electron-forge/publisher-s3',
config: {
// ...
keyResolver: (fileName: string, platform: string, arch: string) => {
return `some-prefix/${platform}/${arch}/filename`;
}
// ...
}
}
{% endcode %} {% endhint %}
\