Make macOS notarization optional for packaging

This commit is contained in:
Zach Wasserman 2021-02-17 16:22:03 -08:00
parent c1dc28d32c
commit bc58206b96
3 changed files with 11 additions and 2 deletions

View file

@ -66,6 +66,11 @@ func main() {
Usage: "Identity to use for codesigning",
Destination: &opt.SignIdentity,
},
&cli.BoolFlag{
Name: "notarize",
Usage: "Whether to notarize macOS packages",
Destination: &opt.Notarize,
},
&cli.BoolFlag{
Name: "debug",
Usage: "Enable debug logging",

View file

@ -102,8 +102,10 @@ func BuildPkg(opt Options) error {
}
}
if err := notarizePkg(generatedPath); err != nil {
return err
if opt.Notarize {
if err := notarizePkg(generatedPath); err != nil {
return err
}
}
filename := fmt.Sprintf("orbit-osquery_%s_amd64.pkg", opt.Version)

View file

@ -27,6 +27,8 @@ type Options struct {
Insecure bool
// SignIdentity is the codesigning identity to use (only macOS at this time)
SignIdentity string
// Notarize sets whether macOS packages should be Notarized.
Notarize bool
}
func copyFile(srcPath, dstPath string, perm os.FileMode) error {