Can Xcode Cloud produce a notarized .pkg for a macOS daemon?

I have a macOS app (a background daemon) that I distribute outside the App Store as a .pkg installer. My build process is:

  1. Build the app (xcodebuild archive)
  2. Sign the app with Developer ID Application
  3. Package it with pkgbuild, signed with Developer ID Installer
  4. Notarize with notarytool
  5. Staple with stapler

This works perfectly on my local machine using custom build_pkg.sh.

I'm trying to automate this in Xcode Cloud using a ci_post_xcodebuild.sh script so a new build is triggered whenever I push to git repository. The problem is:

• security find​-identity shows 0 valid identities in the post-build script environment • The archived app has Signature​=adhoc (no Developer ID signing) • pkgbuild can't sign the .pkg without a Developer ID Installer certificate • Notarization rejects everything because nothing is signed with Developer ID

My question: Is there any way to make Developer ID certificates available in Xcode Cloud's post-build scripts? Or is Xcode Cloud only designed for App Store distribution, and I need to use a different CI (like GitHub Actions) for Developer ID / notarized .pkg workflows? Are there other ways to trigger creation of notarized pkg files whenever I push to GitHub?

Can Xcode Cloud produce a notarized .pkg for a macOS daemon?
 
 
Q