neuralinterfaces / commoners

Cross-Platform Development for the Rest of Us
https://commoners.dev/
MIT License
6 stars 0 forks source link

Fix Signed Builds #3

Open garrettmflynn opened 10 months ago

garrettmflynn commented 10 months ago

Builds break immediately after being signed—specifically on Mac M2. Including identity: null fixes this problem—but, in the long run, will result in an inability to create applications that can be widely shared.

One possible solution is to dynamically add the identity: null declaration if the conditions for notarization aren't met on Mac, though we'll first have to check that proper notarization fixes this problem in the first place.

garrettmflynn commented 10 months ago

For further context, this also happens on my Intel Mac, though this throws a CSSMER_TP_CERT_REVOKED error that results in the same The application "X" can't be opened error appearing when the app is opened.

These resources may be helpful for resolving this issue on systems running MacOS:

  1. https://github.com/electron-userland/electron-builder/issues/1046
  2. https://github.com/electron-userland/electron-builder/issues/6564

This is avoided on the commoners-starter-kit because the process:

skipped macOS application code signing  reason=cannot find valid "Developer ID Application" identity or custom non-Apple code signing certificate, it could cause some undefined behaviour, e.g. macOS localized description not visible, see https://electron.build/code-signing allIdentities=     0 identities found

So at least for Github Actions, this can be subverted by setting secrets like APPLE_DEVELOPER_ID_IDENTITY_HASH, APPLE_DEVELOPER_ID_NAME, APPLE_ID, APPLE_PASSWORD, MACOS_CERTIFICATE, and MACOS_CERTIFICATE_PWD.