Skip to content

Commit

Permalink
Adding entitlements file specification to code signing in deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
alleus committed Oct 2, 2024
1 parent 26f3d34 commit e209fa7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions deploy_new_version/Sources/deploy/build_xcode_project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
])
}
Expand Down
3 changes: 2 additions & 1 deletion deploy_new_version/Sources/deploy/deploy_new_version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ func deployNewVersion(
projectDirectory: URL,
scheme: String,
bundleId: String,
entitlements: String,
profileData: Data,
identityData: Data,
identityPassword: String,
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions deploy_new_version/Sources/deploy/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit e209fa7

Please sign in to comment.