[Beta-Updates]: fix verify step for beta artifact verifications

This commit is contained in:
Magesh K
2024-12-18 02:50:50 +05:30
parent 7af0992a2b
commit 2eeaeca8f4
3 changed files with 10 additions and 5 deletions

View File

@@ -129,9 +129,13 @@ private extension VerifyAppOperation
{
let (version, buildVersion) = await $appVersion.perform { ($0.version, $0.buildVersion) }
let downloadedIpaRevision = Bundle.init(url: app.fileURL)!.object(forInfoDictionaryKey: "BuildRevision") as? String ?? ""
guard version == app.version else { throw VerificationError.mismatchedVersion(app.version, expectedVersion: version, app: app) }
let downloadedIpaRevision = Bundle(url: app.fileURL)!.object(forInfoDictionaryKey: "BuildRevision") as? String ?? ""
let sourceJsonIpaRevision = appVersion.revision
// if not beta but version matches, then accept it, else compare revisions between source and downloaded
if version != app.version || (appVersion.isBeta && downloadedIpaRevision != sourceJsonIpaRevision) {
throw VerificationError.mismatchedVersion(app.version, expectedVersion: version, app: app)
}
if let buildVersion
{