From e209fa75f144a4a29ad5963ce4d55ae010f946cd Mon Sep 17 00:00:00 2001 From: Martin Alleus Date: Wed, 2 Oct 2024 17:35:58 +0200 Subject: [PATCH] Adding entitlements file specification to code signing in deploy script --- deploy_new_version/Sources/deploy/build_xcode_project.swift | 2 ++ deploy_new_version/Sources/deploy/deploy_new_version.swift | 3 ++- deploy_new_version/Sources/deploy/main.swift | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/deploy_new_version/Sources/deploy/build_xcode_project.swift b/deploy_new_version/Sources/deploy/build_xcode_project.swift index 5173b39..7f577e3 100644 --- a/deploy_new_version/Sources/deploy/build_xcode_project.swift +++ b/deploy_new_version/Sources/deploy/build_xcode_project.swift @@ -47,11 +47,13 @@ func codeSignBundle( projectDirectory: URL, archiveURL: URL, identityName: String, + entitlements: String, appBuildName: String //e.g. Example-app ) throws { let path = archiveURL.appendingPathComponent("/Products/Applications/\(appBuildName).app").path try run(name: "codeSignBundle", workingDirectory: projectDirectory, "/usr/bin/codesign", [ "-s", identityName, + "--entitlements", entitlements, path ]) } diff --git a/deploy_new_version/Sources/deploy/deploy_new_version.swift b/deploy_new_version/Sources/deploy/deploy_new_version.swift index b375630..03ad222 100644 --- a/deploy_new_version/Sources/deploy/deploy_new_version.swift +++ b/deploy_new_version/Sources/deploy/deploy_new_version.swift @@ -7,6 +7,7 @@ func deployNewVersion( projectDirectory: URL, scheme: String, bundleId: String, + entitlements: String, profileData: Data, identityData: Data, identityPassword: String, @@ -39,7 +40,7 @@ func deployNewVersion( let archiveURL = tempDir.appendingPathComponent("Archive.xcarchive", isDirectory: false) try archiveUnsigned(projectDirectory: projectDirectory, archiveURL: archiveURL, scheme: scheme, version: nextVersion) - try codeSignBundle(projectDirectory: projectDirectory, archiveURL: archiveURL, identityName: identityName, appBuildName: "Example-app") + try codeSignBundle(projectDirectory: projectDirectory, archiveURL: archiveURL, identityName: identityName, entitlements: entitlements, appBuildName: "Example-app") let exportDirectory = tempDir.appendingPathComponent("export", isDirectory: true) try exportArchive(projectDirectory: projectDirectory, archiveURL: archiveURL, exportDirectory: exportDirectory, exportOptionsPlistURL: exportOptionsPlistURL) diff --git a/deploy_new_version/Sources/deploy/main.swift b/deploy_new_version/Sources/deploy/main.swift index acc9019..e99f69d 100644 --- a/deploy_new_version/Sources/deploy/main.swift +++ b/deploy_new_version/Sources/deploy/main.swift @@ -6,6 +6,7 @@ do { projectDirectory: URL(fileURLWithPath: env("GITHUB_WORKSPACE")), scheme: "Example-app", bundleId: "com.swedbankpay.exampleapp", + entitlements: "Example-app/Example-app.entitlements", profileData: envBase64("XCODE_PROVISIONING_PROFILE"), identityData: envBase64("XCODE_SIGNING_CERT"), identityPassword: env("XCODE_SIGNING_CERT_PASSWORD"),