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

Switch to electron-builder #165

Merged
merged 12 commits into from
Mar 1, 2017
Merged

Conversation

apetresc
Copy link
Member

@apetresc apetresc commented Feb 6, 2017

This addresses #158.

Electron-packager generates standalone packages, while electron-builder can generate platform-specific installers. There are several benefits of electron-builder, including:

  • Generate familiar-feeling installers for each platform: .DMG images for OS X, MSI installers for Windows (which can be installed/uninstalled from the system Control Panel), and .deb/.rpm/PKGBUILD files for Linux.
  • Nicer configuration in package.json in my opinion. There's a separate config section instead of passing in a bunch of args to each platform's build step.
  • SGF file association at the OS level.
  • Integration with native app stores, if desired (this isn't part of this PR obviously, but if you ever wanted to be present on the MacOS app store, the Ubuntu repositories, etc, then this is necessary)
  • Support for auto-updates (also not part of this PR since it requires some setup on the GitHub side first)

Some major things I need help with:

  • Some package managers require icon files that are larger than the 256x256 icon that's currently on GitHub. As a temporary workaround, I manually enlarged the 256x256 to 1024x1024 and let electron-builder scale it back down so that the build passes. So the icon looks a bit ugly right now. Obviously it would be ideal to get a native 1024x1024 version... hopefully you still have the vector image :)
  • To get auto-updates working, you need to have one full release on GitHub through electron-builder, and then you have to set up some feeds.

I've tested on all three major platforms on my machines, and everything seems to work well, as far as I can tell. Let me know if you prefer these commits squashed!

Still some fields that need populating to get all the features,
but this should suffice for a simple build for now.
This is NOT A GOOD THING, I just don't have the original high-res
asset so it's a temporary hack. Hopefully I can get a real icns
soon.
Nobody uses AppImage anyway...
package.json Outdated
],
"files": [
"**/*",
"!(build.js|docs|tests?|examples|.c9|scss|^/node_modules/(moment|(octicons|sigma)/(plugins|lib|src|build/font)))($|/)"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we can now split this massive rule up into a series of smaller rules, since build.files supports that. I just didn't wanna mess with it until I was sure it was correct first.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the documentation, it seems like electron-builder isn't using Regex, but glob patterns. I'll look into it...

@yishn
Copy link
Member

yishn commented Feb 6, 2017

Thank you so much! I'll look over it after my exams.

package.json Outdated
},
"win": {
"iconUrl": "https://raw.githubusercontent.com/yishn/sabaki/master/data/icon.ico",
"target": ["msi"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a msi target for Windows? It doesn't work on my machine and I couldn't find the target in the documentation. Maybe we can just provide a 7z or use NSIS?

package.json Outdated
{
"ext": "sgf",
"name": "SGF"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean build/extra-info.plist is redundant now?

package.json Outdated
],
"files": [
"**/*",
"!(build.js|docs|tests?|examples|.c9|scss|^/node_modules/(moment|(octicons|sigma)/(plugins|lib|src|build/font)))($|/)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the documentation, it seems like electron-builder isn't using Regex, but glob patterns. I'll look into it...

Conflicts:
	data/icon.icns
	data/icon.ico
@yishn yishn merged commit 3dbee3e into SabakiHQ:master Mar 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants