You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Release job and notarizing on electron-builder 26 #359
What does samuelmeuli/action-electron-builder@v1 do in .github/workflows/build.yaml (cert import, publish decision, env), and which plain steps and env vars (CSC_LINK, CSC_KEY_PASSWORD, GH_TOKEN, notarize vars) reproduce it on electron-builder 26 with tag-only release? Can built-in mac.notarize keep the Developer ID + team 9VR92ZCXA8 guard from scripts/notarize.js, or must the afterSign hook stay?
What the action does (samuelmeuli/action-electron-builder@v1, index.js): sets GH_TOKEN from github_token; on macOS only sets CSC_LINK/CSC_KEY_PASSWORD from mac_certs*; runs yarn again, yarn run build, then electron-builder --<platform> plus --publish always only when release is true. On non-tag builds it passes no--publish flag. Notarize/Sentry env just passes through to electron-builder.
Trap: with no --publish, electron-builder (24 and 26, PublishManager.ts) infers onTagOrDraft on CI, and for the github provider that still uploads to a draft release on branch pushes (gitHubPublisher default releaseType: "draft"). 26 warns this implicit publishing goes away in v27. A tag-only job must pass --publish never on non-tag builds.
Plain replacement:yarn build then yarn electron-builder --<mac|win|linux> --publish ${{ startsWith(github.ref,'refs/tags/v') && 'always' || 'never' }} with env GH_TOKEN=secrets.GITHUB_TOKEN, CSC_LINK/CSC_KEY_PASSWORD set only on macOS (base64 p12 still accepted, codeSign/codesign.ts), and the existing APPLEID* + SENTRY_* vars. YAML is in the notes.
Built-in notarize cannot keep the guard; the afterSign hook stays. In 26.18.1, MacPackager.sign() calls notarizeIfProvided right after codesign, beforeafterSign, so a hook cannot gate it. It is driven only by env (APPLE_ID+APPLE_APP_SPECIFIC_PASSWORD+APPLE_TEAM_ID, or API key, or keychain profile); mac.notarize is just a boolean. Nothing checks the team ID value or the signed bundle's Authority/TeamIdentifier; @electron/notarize's checkSignatures only checks validity.
Hardening found while reading:
Set mac.notarize: false so a future rename to APPLE_* env can't trigger an unguarded second notarization.
Set mac.type: "distribution": without it, findSigningIdentity can fall back to a Mac Developer cert.
If no identity is found, signing is skipped with only a warning, and then afterSign (the guard) is skipped too. Pass -c.forceCodeSigning=true on mac tag builds so a missing cert fails the release.
Sources: action-electron-builder@v1 (action.yml, index.js); electron-builder tag electron-builder@26.18.1 (macPackager.ts, mac/MacTargetHelper.ts, options/macOptions.ts, codeSign/*.ts, platformPackager.ts, publish/PublishManager.ts, electron-publish/src/{publisher,gitHubPublisher}.ts) and v24.13.3; @electron/notarize 3.1.2 lib/check-signature.js.
Not verified: an empty CSC_LINK on Windows counting as unset; GITHUB_TOKEN having contents: write (no permissions: block in the workflow).
Activity
jtklein-agents commentedon Nov 24, 2026
Answer (full notes: https://github.com/jtklein-agents/raxmlGUI/blob/research/release-job-notarize/docs/research/release-job-notarize.md)
What the action does (
samuelmeuli/action-electron-builder@v1,index.js): setsGH_TOKENfromgithub_token; on macOS only setsCSC_LINK/CSC_KEY_PASSWORDfrommac_certs*; runsyarnagain,yarn run build, thenelectron-builder --<platform>plus--publish alwaysonly whenreleaseis true. On non-tag builds it passes no--publishflag. Notarize/Sentry env just passes through to electron-builder.Trap: with no
--publish, electron-builder (24 and 26,PublishManager.ts) infersonTagOrDrafton CI, and for thegithubprovider that still uploads to a draft release on branch pushes (gitHubPublisherdefaultreleaseType: "draft"). 26 warns this implicit publishing goes away in v27. A tag-only job must pass--publish neveron non-tag builds.Plain replacement:
yarn buildthenyarn electron-builder --<mac|win|linux> --publish ${{ startsWith(github.ref,'refs/tags/v') && 'always' || 'never' }}with envGH_TOKEN=secrets.GITHUB_TOKEN,CSC_LINK/CSC_KEY_PASSWORDset only on macOS (base64 p12 still accepted,codeSign/codesign.ts), and the existingAPPLEID*+SENTRY_*vars. YAML is in the notes.Built-in notarize cannot keep the guard; the
afterSignhook stays. In 26.18.1,MacPackager.sign()callsnotarizeIfProvidedright after codesign, beforeafterSign, so a hook cannot gate it. It is driven only by env (APPLE_ID+APPLE_APP_SPECIFIC_PASSWORD+APPLE_TEAM_ID, or API key, or keychain profile);mac.notarizeis just a boolean. Nothing checks the team ID value or the signed bundle'sAuthority/TeamIdentifier;@electron/notarize'scheckSignaturesonly checks validity.Hardening found while reading:
mac.notarize: falseso a future rename toAPPLE_*env can't trigger an unguarded second notarization.mac.type: "distribution": without it,findSigningIdentitycan fall back to aMac Developercert.afterSign(the guard) is skipped too. Pass-c.forceCodeSigning=trueon mac tag builds so a missing cert fails the release.Sources: action-electron-builder@v1 (
action.yml,index.js); electron-builder tagelectron-builder@26.18.1(macPackager.ts,mac/MacTargetHelper.ts,options/macOptions.ts,codeSign/*.ts,platformPackager.ts,publish/PublishManager.ts,electron-publish/src/{publisher,gitHubPublisher}.ts) andv24.13.3;@electron/notarize3.1.2lib/check-signature.js.Not verified: an empty
CSC_LINKon Windows counting as unset;GITHUB_TOKENhavingcontents: write(nopermissions:block in the workflow).