Files
Ncurator/scripts/release/status.mjs
T
hy 7b057c05f8 refactor: reorganize scripts and update paths for build and release processes
- Removed obsolete test script `test_crawl4ai_fit_markdown.py`.
- Deleted `verify-package-main-obfuscation.mjs` as it is no longer needed.
- Updated paths in `app-update-publish-config.test.ts` to reflect new script locations.
- Refactored `package-content-policy.test.ts` to use new paths for content policy scripts.
- Adjusted `package-main-obfuscation.test.ts` to point to the new obfuscation script locations.
- Modified `package-size-budget.test.ts` to use updated paths for size budget scripts.
- Changed `r2-update-metadata-contract.test.ts` to reference the new metadata script.
- Updated `release-fragment-contract.test.ts` to use the new fragment contract script.
- Refactored `release-storage-layout.test.ts` to point to the new storage layout script.
- Added `runtime-trace.test.ts` to test runtime tracing functionality.
- Updated `node-pty-native-release.test.ts` to reflect new paths for native release scripts.
2026-07-20 17:03:38 +08:00

53 lines
2.2 KiB
JavaScript

import process from 'node:process'
import { loadReleaseEnvironment } from './shared/environment.mjs'
import { fetchWithRetry } from './shared/http.mjs'
import {
PUBLIC_RELEASE_BASE_URL,
readPublicReleaseFragment,
resolveAwsExecutable,
verifyPublicReleaseFragment,
verifyR2ReleaseFragment
} from './shared/windows.mjs'
const ROOT = process.cwd()
await loadReleaseEnvironment(ROOT)
const args = process.argv.slice(2)
const tagIndex = args.indexOf('--tag')
const releaseTag = tagIndex >= 0 ? args[tagIndex + 1] || '' : ''
if (!/^v\d+\.\d+\.\d+$/u.test(releaseTag)) {
throw new Error('usage: node scripts/release/status.mjs --tag <v1.2.3>')
}
const publicBaseUrl = String(process.env.R2_PUBLIC_BASE_URL || PUBLIC_RELEASE_BASE_URL).replace(
/\/$/u,
''
)
const platforms = ['windows-x64', 'macos-arm64', 'macos-x64']
const awsExecutable = await resolveAwsExecutable()
if (!awsExecutable) throw new Error('AWS CLI is required to verify release sha512 metadata')
for (const platform of platforms) {
const fragment = await readPublicReleaseFragment(releaseTag, platform, publicBaseUrl)
if (!fragment) {
process.stdout.write(`${platform.padEnd(14)} missing\n`)
continue
}
await verifyPublicReleaseFragment(fragment, publicBaseUrl)
await verifyR2ReleaseFragment(fragment, awsExecutable)
const application = fragment.audit.applications[0]
const installedMiB = (Number(application.totalBytes || 0) / 1024 / 1024).toFixed(1)
process.stdout.write(`${platform.padEnd(14)} ready, audited, installed ${installedMiB} MiB\n`)
}
const [windowsLatestResponse, macLatestResponse] = await Promise.all([
fetchWithRetry(`${publicBaseUrl}/releases/latest/windows.json?check=${Date.now()}`, {
cache: 'no-store'
}),
fetchWithRetry(`${publicBaseUrl}/releases/latest/macos.json?check=${Date.now()}`, {
cache: 'no-store'
})
])
const windowsLatest = windowsLatestResponse.ok ? await windowsLatestResponse.json() : undefined
const macLatest = macLatestResponse.ok ? await macLatestResponse.json() : undefined
process.stdout.write(`windows live ${windowsLatest?.tag === releaseTag ? 'yes' : 'no'}\n`)
process.stdout.write(`macos live ${macLatest?.tag === releaseTag ? 'yes' : 'no'}\n`)