fix(desktop): use full Windows installers within the feed limit

This commit is contained in:
Yun Chan 2026-11-20 21:13:37 +09:00
parent 52df7e7e7b
commit df680e4716
17 changed files with 109 additions and 32 deletions

View file

@ -2,6 +2,7 @@ import { existsSync, readFileSync } from 'node:fs'
import { createHash, createPublicKey } from 'node:crypto'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { supportsWindowsDifferentialDownload } from './lib/desktop-installer-mode.mjs'
const root = join(dirname(fileURLToPath(import.meta.url)), '..', '..')
// canonical updater feed: Forgejo Generic Package Registry
@ -186,6 +187,10 @@ function validate(surfaces) {
'update_policy_staging_invalid',
)
fail(typeof policy?.killSwitch === 'boolean', 'update_policy_kill_switch_missing')
fail(
supportsWindowsDifferentialDownload(surfaces.builder) || policy?.fullInstallVersionGap === 0,
'windows_full_only_policy_mismatch',
)
fail(
surfaces.updatePolicySource.includes('decideUpdate') &&
surfaces.updatePolicySource.includes('fullInstallVersionGap') &&
@ -430,6 +435,13 @@ if (process.argv.includes('--self-test')) {
},
'forgejo_portable_unsupported_upload_artifact',
)
expectRejected(
surfaces,
(candidate) => {
candidate.updatePolicy.fullInstallVersionGap = 3
},
'windows_full_only_policy_mismatch',
)
let missingDesktopKeyRejected = false
try {
loadSurfaces((path) => {
@ -445,7 +457,7 @@ if (process.argv.includes('--self-test')) {
if (!missingDesktopKeyRejected) {
throw new Error('release_metadata_self_test_failed:desktop_license_public_key_missing')
}
result.negativeCases = 18
result.negativeCases = 19
}
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`)