WIP Attempt to Migrate to Electron Forge + GitHub Actions for CI/CD #255
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.
This commit attempts to migrate our deployment process from a manual one to an automated CI/CD process using Electron Forge (https://www.electronforge.io/) to manage signing, notarizing, and building the app. Doing this will provide these benefits:
Here's the primary steps I took thus far (though I branched off in a few different directions for various explorations I can walk through if interested):
forge.config.js
which contains the configuration for forge. Right now, all of the stuff related to signing and notarizing is commented out, as are some of the icon image paths (was mainly trying to get the thing to build first).main
inpackage.json
to point to our webpack configuration atwebpack.config.main.prod.ts
and removed the manual build configurations. Note the originalpackage.json
file is preserved inpackage-old.json
for easier comparison..github/workflows/config.yml
which installs build dependencies and manages the signing and notarizing as part of CI/CD. There are some keys needed here as well.add-osx-cert.sh
, a shell script that sets up a temporary keychain on a macOS machine, imports a certificate into it, and configures it for code signing as part of CI/CD. The github action mentioned above calls this.webpack.config.renderer.prod.ts
(line 19) and the decision to run the prod vs. dev webpack configuration which is made on lines 18 and 123 inforge.config.ts
.We're 90% of the way there, but I keep coming back to the issue that it doesn't like that we're using ESM syntax for imports and exports in
main.ts
even though we can use it just fine in all of our other files. This seems like an easy thing to fix, but each strategy I try creates a new problem with import / export compatibility because we're ultimately using a mix of ESM and require syntax in certain files.Happy to go deep on any of this as I'd love to see this thing make it across the finish line! Unfortunately I think I've taken it about as far as I can without further help!