Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
3 tasks done
TranquilMarmot opened this issue Oct 10, 2023 · 3 comments · Fixed by #3405
Closed
3 tasks done

Comments

@TranquilMarmot
Copy link

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

@TranquilMarmot TranquilMarmot changed the title @electron-forge/maker-zip: If using macUpdateManifestBaseUrl and RELEASES.json doesn't exist, fails @electron-forge/maker-zip: If using macUpdateManifestBaseUrl and RELEASES.json doesn't exist in S3, fails Oct 10, 2023
@spaceandrew
Copy link

spaceandrew commented Nov 9, 2023

I'm also running into this issue, did you find a way around it @TranquilMarmot ?

Edit: looks like I figured it out, I just dropped a RELEASES.json with only {} where it should have been in S3, and it was successfully retrieved and updated.

@TranquilMarmot
Copy link
Author

@spaceandrew if you make an empty RELEASES.json file in S3 where electron-forge expects it to be, it should pass when publishing. You might have to put the current version in there as well, but I'm not sure. Let me know if you need more info and I can get it for you tomorrow!

@spaceandrew
Copy link

@spaceandrew if you make an empty RELEASES.json file in S3 where electron-forge expects it to be, it should pass when publishing. You might have to put the current version in there as well, but I'm not sure. Let me know if you need more info and I can get it for you tomorrow!

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants