build(release): stage local macOS v0.1.0 distribution
This commit is contained in:
@@ -387,6 +387,19 @@ const verifyUpdaterBoundary = async () => {
|
||||
assert(source.includes("server origin must not include credentials"), "Desktop updater must reject server origins that include credentials.");
|
||||
};
|
||||
|
||||
const verifyDesktopServerConfigurationBoundary = async () => {
|
||||
const source = await readFile(resolve(sourceDir, "runtime/desktopServerConfig.ts"), "utf8");
|
||||
assert(
|
||||
source.includes("import.meta.env.VITE_DESKTOP_SERVER_URL"),
|
||||
"Desktop server defaults must come from VITE_DESKTOP_SERVER_URL.",
|
||||
);
|
||||
assert(!source.includes("ctms.huapont.cn"), "The production CTMS origin must not be hard-coded in Desktop runtime source.");
|
||||
assert(
|
||||
source.includes("getStoredDesktopServerUrl() || getDefaultDesktopServerUrl()"),
|
||||
"A manually stored Desktop server URL must override the build-time default.",
|
||||
);
|
||||
};
|
||||
|
||||
const verifyWorkflowGates = async () => {
|
||||
const packageInfo = await readJson(resolve(frontendDir, "package.json"));
|
||||
assert(packageInfo.engines?.node === ">=22.13.0", "package.json must require Node.js >=22.13.0.");
|
||||
@@ -406,6 +419,18 @@ const verifyWorkflowGates = async () => {
|
||||
assert(Boolean(packageInfo.scripts?.[script]), `package.json must define ${script}.`);
|
||||
}
|
||||
|
||||
const provenanceSource = await readFile(resolve(frontendDir, "scripts/create-desktop-release-provenance.mjs"), "utf8");
|
||||
assert(provenanceSource.includes('"macos-first"'), "Release provenance must support the approved v0.1.0 macOS-first stage.");
|
||||
assert(
|
||||
provenanceSource.includes("withheld-pending-combined-verification"),
|
||||
"Staged macOS provenance must record that updater feed activation is withheld.",
|
||||
);
|
||||
const windowsPendingNotice = await readFile(resolve(frontendDir, "desktop-release-windows-pending.txt"), "utf8");
|
||||
assert(
|
||||
windowsPendingNotice.includes("same immutable v0.1.0 tag") && windowsPendingNotice.includes("latest.json is intentionally withheld"),
|
||||
"The staged v0.1.0 release must include an explicit Windows-pending and updater-feed notice.",
|
||||
);
|
||||
|
||||
const releasePolicy = await readJson(resolve(frontendDir, "desktop-release-policy.json"));
|
||||
assert(releasePolicy.schemaVersion === 1, "Desktop release policy schemaVersion must be 1.");
|
||||
assert(
|
||||
@@ -418,6 +443,12 @@ const verifyWorkflowGates = async () => {
|
||||
);
|
||||
if (packageInfo.version === "0.1.0") {
|
||||
assert(Boolean(currentUnsignedException), "Desktop release policy must record the approved v0.1.0 exception.");
|
||||
assert(
|
||||
currentUnsignedException?.macosLocalExactTagFallback === true &&
|
||||
currentUnsignedException?.windowsDelivery === "deferred-same-tag" &&
|
||||
currentUnsignedException?.updaterFeedActivation === "after-combined-platform-verification",
|
||||
"The v0.1.0 exception must constrain local macOS staging, deferred Windows delivery, and updater feed activation.",
|
||||
);
|
||||
}
|
||||
if (currentUnsignedException) {
|
||||
assert(
|
||||
@@ -444,6 +475,7 @@ const verifyWorkflowGates = async () => {
|
||||
}
|
||||
assert(workflow.includes("VITE_BUILD_CHANNEL"), "Client quality gates workflow must inject VITE_BUILD_CHANNEL.");
|
||||
assert(workflow.includes("VITE_BUILD_COMMIT"), "Client quality gates workflow must inject VITE_BUILD_COMMIT.");
|
||||
assert(workflow.includes("VITE_DESKTOP_SERVER_URL"), "Client quality gates workflow must inject VITE_DESKTOP_SERVER_URL.");
|
||||
assert(workflow.match(/node-version: "22\.13"/g)?.length === 2, "Client quality gates must use Node.js 22.13 for Web and Desktop jobs.");
|
||||
|
||||
const releaseWorkflow = await readFile(resolve(rootDir, ".github/workflows/desktop-release-candidate.yml"), "utf8");
|
||||
@@ -463,6 +495,7 @@ const verifyWorkflowGates = async () => {
|
||||
"DESKTOP-RELEASE-PROVENANCE.json",
|
||||
"--require-provenance",
|
||||
"TAURI_SIGNING_PRIVATE_KEY",
|
||||
"VITE_DESKTOP_SERVER_URL",
|
||||
"APPLE_ID",
|
||||
"APPLE_PASSWORD",
|
||||
"APPLE_TEAM_ID",
|
||||
@@ -496,6 +529,7 @@ const verifyWorkflowGates = async () => {
|
||||
"runs-on: windows-latest",
|
||||
"VITE_BUILD_CHANNEL",
|
||||
"VITE_BUILD_COMMIT",
|
||||
"VITE_DESKTOP_SERVER_URL",
|
||||
"npm run release:env:check",
|
||||
"npm run version:check",
|
||||
"npm run runtime:check",
|
||||
@@ -554,6 +588,7 @@ await verifySourceSafety();
|
||||
await verifyNotificationBoundary();
|
||||
await verifySessionBoundary();
|
||||
await verifyUpdaterBoundary();
|
||||
await verifyDesktopServerConfigurationBoundary();
|
||||
await verifyOnlyOfficeBoundary();
|
||||
await verifyWorkflowGates();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user