From 7619036c6f1398c10be18d7599c0591c18f06801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com> Date: Wed, 19 Aug 2026 04:59:22 +0800 Subject: [PATCH] fix: encode Xcode archive creation date --- .../hololake-native-desktop/scripts/release-pipeline.mjs | 9 ++++++++- .../scripts/release-pipeline.test.mjs | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/product-source/hololake-native-desktop/scripts/release-pipeline.mjs b/product-source/hololake-native-desktop/scripts/release-pipeline.mjs index 1a6be7a61..5b9979618 100644 --- a/product-source/hololake-native-desktop/scripts/release-pipeline.mjs +++ b/product-source/hololake-native-desktop/scripts/release-pipeline.mjs @@ -234,6 +234,13 @@ function localDateDirectory() { return `${date.getFullYear()}-${part(date.getMonth() + 1)}-${part(date.getDate())}` } +export function formatPlistDate(date) { + const weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] + const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] + const part = (value) => String(value).padStart(2, '0') + return `${weekdays[date.getUTCDay()]} ${months[date.getUTCMonth()]} ${part(date.getUTCDate())} ${part(date.getUTCHours())}:${part(date.getUTCMinutes())}:${part(date.getUTCSeconds())} ${date.getUTCFullYear()}` +} + function createXcodeArchive(application, input) { const archive = path.join( os.homedir(), @@ -249,7 +256,7 @@ function createXcodeArchive(application, input) { run('/usr/bin/plutil', ['-create', 'xml1', info]) const add = (key, type, value) => run('/usr/libexec/PlistBuddy', ['-c', `Add :${key} ${type} ${value}`, info]) add('ArchiveVersion', 'integer', '2') - add('CreationDate', 'date', new Date().toISOString()) + add('CreationDate', 'date', formatPlistDate(new Date())) add('Name', 'string', `HoloLake ${input.version} ${input.sourceCommit.slice(0, 12)}`) add('SchemeName', 'string', 'HoloLake') add('HoloLakeSourceCommit', 'string', input.sourceCommit) diff --git a/product-source/hololake-native-desktop/scripts/release-pipeline.test.mjs b/product-source/hololake-native-desktop/scripts/release-pipeline.test.mjs index 1723eb6dd..118453447 100644 --- a/product-source/hololake-native-desktop/scripts/release-pipeline.test.mjs +++ b/product-source/hololake-native-desktop/scripts/release-pipeline.test.mjs @@ -3,6 +3,7 @@ import { readFileSync } from 'node:fs' import test from 'node:test' import { + formatPlistDate, materializeUpdaterPrivateKey, validateCredentialEnvironment, validateReleaseInput, @@ -39,6 +40,10 @@ const readyInput = () => ({ restartMessage: 'Restart manually', }) +test('Xcode archive creation uses the plist date format accepted by PlistBuddy', () => { + assert.equal(formatPlistDate(new Date('2026-08-19T01:02:03Z')), 'Wed Aug 19 01:02:03 2026') +}) + test('release pipeline refuses an unprovisioned or upstream-owned trust document', () => { const unprovisioned = readyTrust() unprovisioned.state = 'UNPROVISIONED_FAIL_CLOSED'