Add codesign function to macos builder
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 19 Jun 2024 12:29:22 +0000 (20:29 +0800)
committerClaudio Cambra <developer@claudiocambra.com>
Mon, 8 Jul 2024 07:41:45 +0000 (15:41 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
admin/osx/craft-client.swift

index 9afd751e2fe7c60d4b04235aac1883e6610333d0..cf8b12f7e12a185c81c27bcef5a910b1435b82d0 100644 (file)
@@ -62,6 +62,19 @@ func installIfMissing(
     } 
 }
 
+func codesign(
+    identity: String,
+    path: String,
+    options: String = "--timestamp --force --preserve-metadata=entitlements --verbose=4 --options runtime"
+) {
+    print("Code-signing \(path)...")
+    let command = "codesign -s \"\(identity)\" \(options) \(path)"
+    guard shell(command) == 0 else {
+        print("Failed to code-sign \(path).")
+        exit(1)
+    }
+}
+
 print("Configuring build tooling.")
 
 installIfMissing("git", "xcode-select --install")