Enable isolated Capsule Local automatic update testing

This commit is contained in:
2026-09-12 22:18:16 -04:00
parent edefc74c1a
commit a767ee4514
12 changed files with 85 additions and 17 deletions

View File

@ -4,10 +4,13 @@ import { createBuildConfig } from '../build/config.mjs'
import { writeReleaseManifest } from './releaseArtifacts.mjs'
const args = process.argv.slice(2)
if (args.some((arg) => !['--release', '--dir'].includes(arg))) {
throw new Error('Usage: node scripts/package.mjs [--release] [--dir]')
if (args.some((arg) => !['--release', '--dir', '--test-updates', '--bootstrap'].includes(arg))) {
throw new Error('Usage: node scripts/package.mjs [--release | --test-updates [--bootstrap]] [--dir]')
}
const release = args.includes('--release')
const testUpdates = args.includes('--test-updates')
const bootstrap = args.includes('--bootstrap')
if (testUpdates && args.includes('--dir')) throw new Error('Test update builds must produce an installer.')
if (release && args.includes('--dir')) throw new Error('Release builds must produce an installer.')
// Never let a failed rebuild leave an older directory looking publishable.
if (release) {
@ -15,12 +18,13 @@ if (release) {
} else {
process.env.CSC_IDENTITY_AUTO_DISCOVERY = 'false'
}
const config = createBuildConfig({ release })
const config = createBuildConfig({ release, testUpdates, bootstrap })
if (testUpdates) await rm(`${config.directories.output}/release-ready.json`, { force: true })
await build({
config,
targets: Platform.WINDOWS.createTarget(args.includes('--dir') ? ['dir'] : ['nsis'], Arch.x64),
publish: 'never'
})
if (release) {
if (release || testUpdates) {
await writeReleaseManifest(config.directories.output, config.publish[0].url)
}