Ship signed universal macOS probo-agent pkg

Publish a notarized arm64+x86_64 .pkg from CI with the CGO tray
binary, Probo Agent.app, and global LaunchAgent. Keep the
LaunchDaemon enrollment-gated, align its plist path with the
launchd label, and document the Apple signing secrets.

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
This commit is contained in:
Ludovic Vielle
2026-07-17 13:59:16 +02:00
parent 4a56be2e3e
commit afe0c84881
8 changed files with 528 additions and 78 deletions

View File

@@ -31,7 +31,9 @@ import (
"text/template"
)
const plistPath = "/Library/LaunchDaemons/com.getprobo.agent.plist"
const (
plistPath = "/Library/LaunchDaemons/com.probo.agent.plist"
)
const launchdPlistTmpl = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
@@ -72,6 +74,15 @@ func xmlEscape(v string) (string, error) {
return sb.String(), nil
}
func removeLaunchDaemonPlist(path string) error {
_ = exec.Command("launchctl", "bootout", "system", path).Run()
if err := os.Remove(path); err != nil && !errors.Is(err, os.ErrNotExist) {
return fmt.Errorf("cannot remove plist %s: %w", path, err)
}
return nil
}
// Install writes and boots the launchd plist.
func Install(cfg Config) error {
if cfg.ExePath == "" {
@@ -117,10 +128,7 @@ func Install(cfg Config) error {
// Uninstall bootouts and removes the launchd plist.
func Uninstall(cfg Config) error {
_ = exec.Command("launchctl", "bootout", "system", plistPath).Run()
if err := os.Remove(plistPath); err != nil && !errors.Is(err, os.ErrNotExist) {
return fmt.Errorf("cannot remove plist: %w", err)
}
_ = cfg
return nil
return removeLaunchDaemonPlist(plistPath)
}