From 3888b14376c6305d1f8ee372a5194bbf368b5563 Mon Sep 17 00:00:00 2001 From: Sebastian Bean Date: Sun, 19 Jan 2025 15:01:20 -0800 Subject: [PATCH 1/3] add s3 checksum option --- packages/publisher/s3/src/Config.ts | 7 +++++++ packages/publisher/s3/src/PublisherS3.ts | 1 + 2 files changed, 8 insertions(+) diff --git a/packages/publisher/s3/src/Config.ts b/packages/publisher/s3/src/Config.ts index 52abd50a30..0428b67951 100644 --- a/packages/publisher/s3/src/Config.ts +++ b/packages/publisher/s3/src/Config.ts @@ -62,6 +62,13 @@ export interface PublisherS3Config { * Default: false */ s3ForcePathStyle?: boolean; + + /** + * Whether to calculate checksums for uploaded files (Fix for Cloudflare R2) + * + * Default: false + */ + s3RequestChecksumCalculation?: 'WHEN_SUPPORTED' | 'WHEN_REQUIRED'; /** * Custom function to provide the key to upload a given file to */ diff --git a/packages/publisher/s3/src/PublisherS3.ts b/packages/publisher/s3/src/PublisherS3.ts index d5994538ad..9e9964abc7 100644 --- a/packages/publisher/s3/src/PublisherS3.ts +++ b/packages/publisher/s3/src/PublisherS3.ts @@ -48,6 +48,7 @@ export default class PublisherS3 extends PublisherStatic { region: this.config.region, endpoint: this.config.endpoint, forcePathStyle: !!this.config.s3ForcePathStyle, + requestChecksumCalculation: this.config.s3RequestChecksumCalculation, }); d('creating s3 client with options:', this.config); From e5ac78950d4b466b2125606eed5c7ff1532c0340 Mon Sep 17 00:00:00 2001 From: Sebastian Bean Date: Sun, 19 Jan 2025 15:19:05 -0800 Subject: [PATCH 2/3] use ts file with change --- packages/publisher/s3/package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/publisher/s3/package.json b/packages/publisher/s3/package.json index 08b04bd2ee..589f4ca08a 100644 --- a/packages/publisher/s3/package.json +++ b/packages/publisher/s3/package.json @@ -5,8 +5,7 @@ "repository": "https://github.com/electron/forge", "author": "Samuel Attard", "license": "MIT", - "main": "dist/PublisherS3.js", - "typings": "dist/PublisherS3.d.ts", + "main": "src/PublisherS3.ts", "devDependencies": { "chai": "^4.3.3", "mocha": "^9.0.1" @@ -29,4 +28,4 @@ "dist", "src" ] -} +} \ No newline at end of file From 0817080386b35a257bc4d0ff3574cd4f909ac489 Mon Sep 17 00:00:00 2001 From: Sebastian Bean Date: Sun, 19 Jan 2025 16:41:19 -0800 Subject: [PATCH 3/3] Update package.json --- packages/publisher/s3/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/publisher/s3/package.json b/packages/publisher/s3/package.json index 589f4ca08a..a55064afda 100644 --- a/packages/publisher/s3/package.json +++ b/packages/publisher/s3/package.json @@ -5,7 +5,7 @@ "repository": "https://github.com/electron/forge", "author": "Samuel Attard", "license": "MIT", - "main": "src/PublisherS3.ts", + "main": "dist/PublisherS3.ts", "devDependencies": { "chai": "^4.3.3", "mocha": "^9.0.1" @@ -28,4 +28,4 @@ "dist", "src" ] -} \ No newline at end of file +}