|
1 | 1 | import fs from 'fs';
|
2 | 2 | import path from 'path';
|
3 | 3 |
|
4 |
| -import { S3Client } from '@aws-sdk/client-s3'; |
| 4 | +import { PutObjectCommandInput, S3Client } from '@aws-sdk/client-s3'; |
5 | 5 | import { Progress, Upload } from '@aws-sdk/lib-storage';
|
6 | 6 | import { Credentials } from '@aws-sdk/types';
|
7 | 7 | import { PublisherOptions, PublisherStatic } from '@electron-forge/publisher-static';
|
@@ -59,15 +59,18 @@ export default class PublisherS3 extends PublisherStatic<PublisherS3Config> {
|
59 | 59 | await Promise.all(
|
60 | 60 | artifacts.map(async (artifact) => {
|
61 | 61 | d('uploading:', artifact.path);
|
| 62 | + const params: PutObjectCommandInput = { |
| 63 | + Body: fs.createReadStream(artifact.path), |
| 64 | + Bucket: this.config.bucket, |
| 65 | + Key: this.keyForArtifact(artifact), |
| 66 | + }; |
| 67 | + if (!this.config.omitAcl) { |
| 68 | + params.ACL = this.config.public ? 'public-read' : 'private'; |
| 69 | + } |
62 | 70 | const uploader = new Upload({
|
63 | 71 | client: s3Client,
|
64 | 72 | leavePartsOnError: true,
|
65 |
| - params: { |
66 |
| - Body: fs.createReadStream(artifact.path), |
67 |
| - Bucket: this.config.bucket, |
68 |
| - Key: this.keyForArtifact(artifact), |
69 |
| - ACL: this.config.public ? 'public-read' : 'private', |
70 |
| - }, |
| 73 | + params, |
71 | 74 | });
|
72 | 75 |
|
73 | 76 | uploader.on('httpUploadProgress', (progress: Progress) => {
|
|
0 commit comments