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

Improve S3 publishing defaults #542

Closed
3 tasks done
starkos opened this issue Jul 25, 2018 · 4 comments
Closed
3 tasks done

Improve S3 publishing defaults #542

starkos opened this issue Jul 25, 2018 · 4 comments

Comments

@starkos
Copy link

starkos commented Jul 25, 2018

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

Please describe your issue:

Using v5.x…out of the box, the defaults for publishing to S3 don't seem to be very useful, requiring customizations or workarounds. I might be missing something?

TL;DR: I think, unless I'm missing something, that the default value for config.s3.folder, which currently defaults to the application version, would be better as "{name}-{platform}-{arch}" e.g. "MyApp-win32-x64".

In package.json, I set up the S3 configuration like:

"s3": {
  "bucket": "my.bucket.name",
  "public": true
}

When I publish, say on Windows, the installer and the RELEASES file will get published into folder named for the current version, e.g. s3://my.bucket/name/v1.0.0.

When I initialize Electron's autoUpdater, I have to provide it the URL to check for updates, which for this example would be https://s3-us-east-1.amazonaws.com/my.bucket.name/v1.0.0.

Using those defaults, when I publish the next version, it will get written to S3 at s3://my.bucket/name/v1.0.1. But autoUpdater will never see that update, because it is still looking at https://s3-us-east-1.amazonaws.com/my.bucket.name/v1.0.0, which doesn't have the new RELEASES file. To fix it, I have to override the default folder name with something explicit, like the name of my application:

"s3": {
  "bucket": "my.bucket.name",
  "folder": "MyApp",
  "public": true
}

Now, for Windows, I want to publish 32- and 64-bit builds so I run…

$ electron-forge publish --target s3 --arch all

Which mostly works, except that the x64 installer overwrites the ia32 installer on S3, since they are both written to the same "MyApp" folder. To get around that, you really need to include the architecture in the folder name somewhere, e.g. "MyApp-ia32" or better yet "MyApp-win32-ia32", but there's no great way (that I know of) to do that.

Is did see #482, which adds keyResolver to v6.0 to address it (for issue #374). There doesn't seem to be any mention of it in the docs, though? I'm sure I can sort it out, but it feels like a fairly advanced feature just to get S3 publishing to not step on itself?

I should be able to submit a PR to change the default for s3.folder to something more like "{name}-{platform}-{arch}", but I wanted to make sure that a) this was something that was actually desired, and b) that I wasn't missing something obvious (which happens all too often). Thanks!

@MarshallOfSound
Copy link
Member

@starkos Making a change like that would be a breaking change 😢

You can make a file path like "{name}-{platform}-{arch}" using the keyResolver option, does this not work for your use case?

@starkos
Copy link
Author

starkos commented Jul 29, 2018

You can make a file path…using the keyResolver option, does this not work for your use case?

I was under the impression keyResolver wasn't available in v5, I'll give it a try? Is there a usage example around anywhere, I couldn't find one? (In the meantime I'll pull the code and look there.) Disregard, I see it is only in v6. I'll try to get up and running there.

@starkos
Copy link
Author

starkos commented Jul 29, 2018

I'm having nothing but issues trying to get v6 running with the react-typescript template. I'll go ahead and close this issue as "by design" and open new issues for v6 when I can.

@starkos starkos closed this as completed Jul 29, 2018
@malept
Copy link
Member

malept commented Jul 29, 2018

The templates haven't been ported to v6 yet (one of the reasons why it's still in beta). In fact, what's most likely going to happen is that the only first-party templates that will be provided will be to provide bundlers (webpack/parcel).

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

No branches or pull requests

3 participants