1. Things you need.
a. The latest version of XCode
b. A Mac Dec Center Acoount ($99/year)
2. Go to developer.apple.com and create 2 distribution certificates in the Mac Apps category (not IOS, that is separate) of the following types
a. Mac App Distribution
b. Mac Installer Distribution
3. Install these certificates in the keychain. Here is a screenshot after installing both these certificates in keychain access.