mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-24 14:05:58 +03:00
Move packaging procedures into a single function in mac crafter
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
b1ad91d7cb
commit
0b588b8db4
2 changed files with 59 additions and 33 deletions
|
@ -71,3 +71,52 @@ func signSparklePackage(sparkleTbzPath: String, buildPath: String, signKey: Stri
|
|||
throw PackagingError.packageSparkleSignError("Could not sign Sparkle package tbz!")
|
||||
}
|
||||
}
|
||||
|
||||
func packageAppBundle(
|
||||
productPath: String,
|
||||
buildPath: String,
|
||||
craftTarget: String,
|
||||
craftBlueprintName: String,
|
||||
appName: String,
|
||||
packageSigningId: String?,
|
||||
appleId: String?,
|
||||
applePassword: String?,
|
||||
appleTeamId: String?,
|
||||
sparklePackageSignKey: String?
|
||||
) throws {
|
||||
print("Creating pkg file for client…")
|
||||
let buildWorkPath = "\(buildPath)/\(craftTarget)/build/\(craftBlueprintName)/work/build"
|
||||
let packagePath = try buildPackage(
|
||||
appName: appName,
|
||||
buildWorkPath: buildWorkPath,
|
||||
productPath: productPath
|
||||
)
|
||||
|
||||
if let packageSigningId {
|
||||
print("Signing pkg with \(packageSigningId)…")
|
||||
try signPackage(packagePath: packagePath, packageSigningId: packageSigningId)
|
||||
|
||||
if let appleId, let applePassword, let appleTeamId {
|
||||
print("Notarising pkg with Apple ID \(appleId)…")
|
||||
try notarisePackage(
|
||||
packagePath: packagePath,
|
||||
appleId: appleId,
|
||||
applePassword: applePassword,
|
||||
appleTeamId: appleTeamId
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
print("Creating Sparkle TBZ file…")
|
||||
let sparklePackagePath =
|
||||
try buildSparklePackage(packagePath: packagePath, buildPath: buildPath)
|
||||
|
||||
if let sparklePackageSignKey {
|
||||
print("Signing Sparkle TBZ file…")
|
||||
try signSparklePackage(
|
||||
sparkleTbzPath: sparklePackagePath,
|
||||
buildPath: buildPath,
|
||||
signKey: sparklePackageSignKey
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -228,42 +228,19 @@ struct Build: ParsableCommand {
|
|||
try fm.copyItem(atPath: clientAppDir, toPath: "\(productPath)/\(appName).app")
|
||||
|
||||
if package {
|
||||
print("Creating pkg file for client…")
|
||||
let buildWorkPath = "\(clientBuildDir)/work/build"
|
||||
let packagePath = try buildPackage(
|
||||
try packageAppBundle(
|
||||
productPath: productPath,
|
||||
buildPath: buildPath,
|
||||
craftTarget: craftTarget,
|
||||
craftBlueprintName: craftBlueprintName,
|
||||
appName: appName,
|
||||
buildWorkPath: buildWorkPath,
|
||||
productPath: productPath
|
||||
)
|
||||
|
||||
if let packageSigningId {
|
||||
print("Signing pkg with \(packageSigningId)…")
|
||||
try signPackage(packagePath: packagePath, packageSigningId: packageSigningId)
|
||||
|
||||
if let appleId, let applePassword, let appleTeamId {
|
||||
print("Notarising pkg with Apple ID \(appleId)…")
|
||||
try notarisePackage(
|
||||
packagePath: packagePath,
|
||||
packageSigningId: packageSigningId,
|
||||
appleId: appleId,
|
||||
applePassword: applePassword,
|
||||
appleTeamId: appleTeamId
|
||||
appleTeamId: appleTeamId,
|
||||
sparklePackageSignKey: sparklePackageSignKey
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
print("Creating Sparkle TBZ file…")
|
||||
let sparklePackagePath =
|
||||
try buildSparklePackage(packagePath: packagePath, buildPath: buildPath)
|
||||
|
||||
if let sparklePackageSignKey {
|
||||
print("Signing Sparkle TBZ file…")
|
||||
try signSparklePackage(
|
||||
sparkleTbzPath: sparklePackagePath,
|
||||
buildPath: buildPath,
|
||||
signKey: sparklePackageSignKey
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
print("Done!")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue