|
|
@@ -489,10 +489,7 @@ func buildTar(target target) {
|
|
|
}
|
|
|
|
|
|
build(target, tags)
|
|
|
-
|
|
|
- if goos == "darwin" {
|
|
|
- macosCodesign(target.BinaryName())
|
|
|
- }
|
|
|
+ codesign(target)
|
|
|
|
|
|
for i := range target.archiveFiles {
|
|
|
target.archiveFiles[i].src = strings.Replace(target.archiveFiles[i].src, "{{binary}}", target.BinaryName(), 1)
|
|
|
@@ -515,10 +512,7 @@ func buildZip(target target) {
|
|
|
}
|
|
|
|
|
|
build(target, tags)
|
|
|
-
|
|
|
- if goos == "windows" {
|
|
|
- windowsCodesign(target.BinaryName())
|
|
|
- }
|
|
|
+ codesign(target)
|
|
|
|
|
|
for i := range target.archiveFiles {
|
|
|
target.archiveFiles[i].src = strings.Replace(target.archiveFiles[i].src, "{{binary}}", target.BinaryName(), 1)
|
|
|
@@ -1179,6 +1173,15 @@ func zipFile(out string, files []archiveFile) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+func codesign(target target) {
|
|
|
+ switch goos {
|
|
|
+ case "windows":
|
|
|
+ windowsCodesign(target.BinaryName())
|
|
|
+ case "darwin":
|
|
|
+ macosCodesign(target.BinaryName())
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
func macosCodesign(file string) {
|
|
|
if pass := os.Getenv("CODESIGN_KEYCHAIN_PASS"); pass != "" {
|
|
|
bs, err := runError("security", "unlock-keychain", "-p", pass)
|