ci: github action for mac, windows, and linux releases#25
Open
Christopher-Hayes wants to merge 29 commits intoantonreshetov:masterfrom
Open
ci: github action for mac, windows, and linux releases#25Christopher-Hayes wants to merge 29 commits intoantonreshetov:masterfrom
Christopher-Hayes wants to merge 29 commits intoantonreshetov:masterfrom
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
Owner
|
@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. |
Contributor
Author
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This creates a
release.ymlthat runs a GitHub action when a tag (such asv1.3.3) is pushed to build releases for MacOS, Windows, and Linux.MacOS:
.dmgWindows:
.exeLinux:
.snapand.AppImageUpdated 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 builddoes 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.jsoninside thebuildJSON object. This follows the setup that the demo for the electron builder GitHub action uses.yarn buildscript no longer runs electron-builder. Electron can still be built locally by instead runningyarn run build:localGitHub 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_certsThe base64 encoded .p12 certificate.mac_certs_passwordThe 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
.snapmarketplace) 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_tokenThis 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-optimizermac_certsGH Secret with the MacOS dev certmac_certs_passwordGH 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