INSTALLER_CERT_NAME=$(keychain list-certificates \
          | jq '[.[]
            | select(.common_name
            | contains("Mac Developer Installer"))
            | .common_name][0]' \
          | xargs)
xcrun productsign --sign "$INSTALLER_CERT_NAME" unsigned.pkg "$PACKAGE_NAME"
rm -f unsigned.pkg

Publish the packaged app to App Store Connect:

    
app-store-connect publish \
    --path "$PACKAGE_NAME"

As mentioned earlier, don’t forget to set your login keychain
as the default to avoid authentication issues
with apps on your machine:
    
keychain use-login

Distribute to registered devices

TestFlight is not available for distributing macOS apps
to internal and external testers. See distribution guide 
to prepare an archive for distribution to designated Mac computers.

Release your app to the App Store