-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
ci: github action for mac, windows, and linux releases #25
base: master
Are you sure you want to change the base?
ci: github action for mac, windows, and linux releases #25
Conversation
electron-builder config moved to package.json to facilitate integration with GitHub Actions
the electorn-builder gh action has the requirement that electron-builder is not run by yarn build, so this part of the script was remove and an additional build script was added to allow local builds
x32 devices are becoming uncommon; its likely that a user mistakenly installs the x32 version; removing x32 target to prevent users from installing the wrong version
removed macos armx64 build target to prevent users from mistakenly installing it
remove fs import that was used for debugging; no longer needed
@Christopher-Hayes Wow, so much work done. I'll be sure to check it out. P.S. better of course first discuss before you start work, because it may be so that the work was in vain. |
@antonreshetov you're right, I was thinking it would be quick little yaml file, but became a bit more complicated than expected 😁 Though, I'll admit the commit count is a bit high because I had to push commits to test the GitHub Action. Feel free to comment on any lines you want to me to explain the reasoning behind. |
Description
This creates a
release.yml
that runs a GitHub action when a tag (such asv1.3.3
) is pushed to build releases for MacOS, Windows, and Linux.MacOS:
.dmg
Windows:
.exe
Linux:
.snap
and.AppImage
Updated the README to provide useful info on how to install different releases. Might need to be split off into a separate Markdown file or shortened, since it's a little verbose.
Example Release on Fork
Here's an example of a release this action produced on my fork of this repo:
https://github.com/Christopher-Hayes/image-optimizer/releases/tag/v1.3.8
To produce that release, I ran this:
When the GitHub Action finishes, it creates a "draft" release for the "v1.3.8" tag with all the release files, you'll just need to manually go to that release in GitHub and "publish" it.
Here are the details of that Action running: https://github.com/Christopher-Hayes/image-optimizer/actions/runs/2444457428
GitHub Action
Uses this electron-builder GH Action: https://github.com/samuelmeuli/action-electron-builder
That GitHub Action requires that
yarn build
does not run electron-builder, that it only builds the frontend. The GitHub Action separately runs the electron-builder. So, this PR needed to do some refactoring to meet that requirement:package.json
inside thebuild
JSON object. This follows the setup that the demo for the electron builder GitHub action uses.yarn build
script no longer runs electron-builder. Electron can still be built locally by instead runningyarn run build:local
GitHub Secrets
MacOS code-signing can be accomplished by adding the following GitHub secrets:
Required for MacOS development, so these GitHub secrets should be in place.
mac_certs
The base64 encoded .p12 certificate.mac_certs_password
The password to the certificate above.This doc talks about how to set the cert up: https://samuelmeuli.com/blog/2019-04-07-packaging-and-publishing-an-electron-app/#code-signing
The GitHub Action README describes how to put that cert into a GitHub Secret: https://github.com/samuelmeuli/action-electron-builder
If pushing builds to Snapcraft (Linux
.snap
marketplace) is desired, a token should be created and set on this GitHub secret:Snaps work just fine without using Snapcraft, and I haven't set this fully up. So, this is an optional feature that can safely be ignored.
snapcraft_token
This doc talks about how to do that: https://abskmj.github.io/notes/posts/github/actions/setup-snapcraft/
Testing on Fork
Manual steps required to get working on
antonreshetov/image-optimizer
mac_certs
GH Secret with the MacOS dev certmac_certs_password
GH Secret with the password to that certMisc Notes
There's a PR (#19) for building on Windows. I believe this PR should still be compatible with that PR.
closes #18