From f45c30d3ff43b067a8dd0af0f33ea9a29043494b Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Wed, 19 Jun 2024 20:29:22 +0800 Subject: [PATCH] Add codesign function to macos builder Signed-off-by: Claudio Cambra --- admin/osx/craft-client.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/admin/osx/craft-client.swift b/admin/osx/craft-client.swift index 9afd751e2..cf8b12f7e 100644 --- a/admin/osx/craft-client.swift +++ b/admin/osx/craft-client.swift @@ -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") -- 2.30.2