jookyboi
10/10/2019 - 12:10 AM

Building for macOS Catalina

Background

electron-builder has a bug where the zip target fails to build a notarized executable for macOS Catalina.

Example Error

The workaround

Assumptions

You're notarizing the build according to this guide: https://medium.com/@TwitterArchiveEraser/notarize-electron-apps-7a5f988406db

Steps

  1. From [app_root] folder, run: electron-builder --publish always. Wait for notarization to complete.
  2. Go to Finder and right-click to compress dist/mac/[YourApp.app]. (This can be scripted with 7zip.)
  3. Rename the zip to [YourApp]-${version}-mac.zip. Overwrite the file with the same name in /dist.
  4. Run ./node_modules/app-builder-bin/mac/app-builder blockmap -i dist/[YourApp]-${version}-mac.zip to get update file info: size, sha512, blockMapSize.
  5. Update dist/latest-mac.yml with the info found from step 4.
  6. Manually upload [YourApp]-${version}-mac.zip and dist/latest-mac.yml to S3/DigitalOcean/Wherever.

At this point, you should have a working zip for macOS Catalina (10.15). Autoupdate should also work.