Skip to content

Release job and notarizing on electron-builder 26 #359

Done

Description

@jtklein-agents

Question

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?

Activity

  1. added
    wayfinder:research
    on Nov 24, 2026
  2. jtklein-agents commented on Nov 24, 2026

    @jtklein-agents
    OwnerAuthor

    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): 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, before afterSign, 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

wayfinder:research

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions