The process is simply quite similar to how we do it for Windows on this link: https://thirteenov.ciihuy.com/how-to-build-your-electron-js-app-as-windows-executable-for-windows/
The only difference is, instead of win32, we use darwin. So the command is like this:
electron-packager ./ YourAppName --platform=darwin --arch=x64 --icon=./icon.icns
And one more, the icon format for Mac is icns.
What about making installer for Mac? We will need this DMG maker in this link:
https://github.com/electron-userland/electron-installer-dmg
Follow the instruction to make DMG installer for Mac.