From fa99126f2d28c14cb5acd6be2b79af3c67e54934 Mon Sep 17 00:00:00 2001 From: web3dev1337 <160291380+web3dev1337@users.noreply.github.com> Date: Sat, 21 Mar 2026 15:05:42 +1100 Subject: [PATCH] fix(ci): check Info.plist version for macOS .app bundles macOS .app bundles don't include the version in the filename (it's always "Agent Workspace.app"). The verify-bundle-version script was checking the filename, which always failed. Now reads CFBundleShortVersionString from Contents/Info.plist for app bundle types instead. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/release/verify-bundle-version.js | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/scripts/release/verify-bundle-version.js b/scripts/release/verify-bundle-version.js index 605d6b2f..54876a8b 100755 --- a/scripts/release/verify-bundle-version.js +++ b/scripts/release/verify-bundle-version.js @@ -99,6 +99,17 @@ function listBundleFiles(bundleTypeDir, extensions) { .map((entry) => path.join(bundleTypeDir, entry)); } +function readMacOSAppBundleVersion(appPath) { + const plistPath = path.join(appPath, 'Contents', 'Info.plist'); + try { + const content = fs.readFileSync(plistPath, 'utf8'); + const match = content.match(/CFBundleShortVersionString<\/key>\s*([^<]+)<\/string>/); + return match ? match[1].trim() : null; + } catch { + return null; + } +} + function verifyBundleVersion({ targetDir, profile, expectedVersion, platform, bundles }) { const normalizedPlatform = normalizePlatform(platform); const bundleTypes = resolveBundleTypes({ bundles, platform: normalizedPlatform }); @@ -135,6 +146,22 @@ function verifyBundleVersion({ targetDir, profile, expectedVersion, platform, bu continue; } + // macOS .app bundles don't include version in filename — check Info.plist + if (bundleType === 'app') { + for (const filePath of files) { + const plistVersion = readMacOSAppBundleVersion(filePath); + if (plistVersion && plistVersion === expectedVersion) { + continue; + } + if (!plistVersion) { + errors.push(`Could not read version from ${path.basename(filePath)}/Contents/Info.plist`); + } else if (plistVersion !== expectedVersion) { + errors.push(`${path.basename(filePath)} has version ${plistVersion}, expected ${expectedVersion}`); + } + } + continue; + } + const matchedFiles = files.filter((filePath) => path.basename(filePath).includes(expectedVersion)); const staleFiles = files.filter((filePath) => !path.basename(filePath).includes(expectedVersion));