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 PR fixes the issue we currently have where the Windows
.exe
file is being signed after the artifacts are published, so they are not being part of the GitHub release and auto-updater.The issue with
electron-builder
is that it cannot generate the artifacts and publish them later, the process cannot be 'paused' in the middle, so we can't run the eSigner GitHub Action to sign it in between.The
electron-builder
configuration provides an escape hatch to sign the executables in a custom way before publishing them, so what I did is the following:electron-builder.yml
into anelectron-builder.cjs
file so we can define the customwin.sign
function.SSLcom/esigner-codesign
repo in an earlier step into the root.win.sign
function I execute a sync child process that runs the GitHub Action's script using node..exe
afterwards.The eSigner GitHub Action is not intended to be used programatically, so I had to do some ugly wiring for it to pick up the configuration (pass some values into the
process.env
) but it works, and it takes care of downloading Java, the CodeSignTool, and perform the signing just fine.I followed this approach from the comment on this issue: electron-userland/electron-builder#6158 (comment)