Skip to content

@electron-forge/maker-zip: If using macUpdateManifestBaseUrl and RELEASES.json doesn't exist in S3, fails #3378

Closed
@TranquilMarmot

Description

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

6.4.2

Electron version

v26.2.4

Operating system

macOS 13.5.2 (22G91)

Last known working Electron Forge version

No response

Expected behavior

When publishing with @electron-forge/maker-zip and macUpdateManifestBaseUrl with forge.config.ts like this:

makers: [
    new MakerZIP((arch) => ({
      macUpdateManifestBaseUrl: `https://my-bucket.s3.amazonaws.com/my-app-updates/darwin/${arch}`,
    })),
]

If https://my-bucket.s3.amazonaws.com/my-app-updates/darwin/${arch}/RELEASES.json does not yet exist, it should be created.

Actual behavior

The publish fails with an error:

An unhandled rejection has occurred inside Forge:
HTTPError: Response code 404 (Not Found)

I believe this is happening here:

// Only generate RELEASES.json for darwin builds (not MAS)
if (targetPlatform === 'darwin' && this.config.macUpdateManifestBaseUrl) {
const parsed = new URL(this.config.macUpdateManifestBaseUrl);
parsed.pathname += '/RELEASES.json';
const response = await got.get(parsed.toString());

await got.get(parsed.toString()); should be wrapped in a try/catch and ignore if the file doesn't exist yet in S3.

Steps to reproduce

Use @electron-forge/maker-zip and macUpdateManifestBaseUrl without RELEASES.json existing in S3

Additional information

No response

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions