Publish triggers afterAllArtifactBuild hook too late
See original GitHub issue- Version: 20.41.0
- Target: Mac
I’m writing an afterAllArtifactBuild
hook where the produced dmg on Mac is notarized using electron-notarize
. This works fine when building (i.e. electron-builder build --mac
): the hook triggers after all targets are built and the dmg is notarized.
When building and publishing to github by running electron-builder build --mac -p always
however, electron-builder
starts uploading the dmg to github even before the afterAllArtifactBuild
hook is triggered.
When simply publishing without building, the afterAllArtifactBuild
is not triggered at all!
Ideally the publish command should wait for the afterAllArtifactBuild
hook to finish running, or not rebuild the targets at all. If publish did not rebuild the targets, one could notarize/generate checksums using the afterAllArtifactBuild
hook then have the publish
command only pickup the generated binaries; Now it overrides anything generated before!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:10 (1 by maintainers)
Top GitHub Comments
“Ideally the publish command should wait for the afterAllArtifactBuild hook to finish running !” I also think this should be the case. Is it the case ? I try to sign the exe on windows in afterAllArtifactBuild but the exe is upload before my script runs…
Updated to add, you can work around this by setting
publish: null
on yourpkg
target, and then returning the path of thepkg
in theafterAllArtifactBuild
hook.