mirror of
https://git.sr.ht/~eliasnaur/gio-cmd
synced 2026-07-07 02:15:32 +00:00
gogio: [macOS] add notarizing
Now, it's possible to notarize the app, using -notaryid, -notarypass and -notaryteamid flags. Those flags are similar to -signkey and -signpass. Signed-off-by: inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
+27
-2
@@ -56,11 +56,17 @@ func buildMac(tmpDir string, bi *buildInfo) error {
|
||||
}
|
||||
}
|
||||
|
||||
if err := dittozip(tmpDest, finalDest+".zip"); err != nil {
|
||||
if err := dittozip(tmpDest, tmpDest+".zip"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := dittounzip(finalDest+".zip", finalDest); err != nil {
|
||||
if bi.notaryAppleID != "" {
|
||||
if err := builder.notarize(bi, tmpDest+".zip"); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err := dittounzip(tmpDest+".zip", finalDest); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -222,6 +228,25 @@ func (b *macBuilder) signProgram(buildInfo *buildInfo, binDest string, name stri
|
||||
return err
|
||||
}
|
||||
|
||||
func (b *macBuilder) notarize(buildInfo *buildInfo, binDest string) error {
|
||||
cmd := exec.Command(
|
||||
"xcrun",
|
||||
"notarytool",
|
||||
"submit",
|
||||
binDest,
|
||||
"--apple-id", buildInfo.notaryAppleID,
|
||||
"--team-id", buildInfo.notaryTeamID,
|
||||
"--wait",
|
||||
)
|
||||
|
||||
if buildInfo.notaryPassword != "" {
|
||||
cmd.Args = append(cmd.Args, "--password", buildInfo.notaryPassword)
|
||||
}
|
||||
|
||||
_, err := runCmd(cmd)
|
||||
return err
|
||||
}
|
||||
|
||||
func dittozip(input, output string) error {
|
||||
cmd := exec.Command("ditto", "-c", "-k", "-X", "--rsrc", input, output)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user