fix(desktop): use full Windows installers within the feed limit
This commit is contained in:
parent
52df7e7e7b
commit
df680e4716
17 changed files with 109 additions and 32 deletions
|
|
@ -15,6 +15,7 @@ import { spawnSync } from 'node:child_process'
|
|||
import { existsSync, readFileSync, readdirSync, rmSync, statSync } from 'node:fs'
|
||||
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)), '..', '..')
|
||||
const desktopDir = join(root, 'apps', 'desktop')
|
||||
|
|
@ -24,6 +25,9 @@ const MAX_UPLOAD_BYTES = 100 * 1024 * 1024
|
|||
const version = JSON.parse(readFileSync(join(root, 'release', 'product-version.json'), 'utf8')).version
|
||||
const releaseDir = join(desktopDir, 'release', version)
|
||||
const appDir = join(releaseDir, 'win-unpacked')
|
||||
const differentialDownload = supportsWindowsDifferentialDownload(
|
||||
readFileSync(join(desktopDir, 'electron-builder.yml'), 'utf8'),
|
||||
)
|
||||
const builderFlags = ['--config', 'electron-builder.yml', '--publish', 'never', '-c.win.forceCodeSigning=false', '-c.npmRebuild=false']
|
||||
|
||||
// 같은 버전을 다시 빌드할 때 이전 산출물(휴대용 zip 등)이 섞여 게시되지 않게 비운다.
|
||||
|
|
@ -39,9 +43,10 @@ run('npx', ['electron-builder', '--prepackaged', appDir, '--win', 'nsis', '--x64
|
|||
|
||||
const installer = readdirSync(releaseDir).find((name) => /-Setup-.*\.exe$/.test(name))
|
||||
if (!installer) fail(`설치본이 없습니다: ${releaseDir}`)
|
||||
for (const required of [`${installer}.blockmap`, 'latest.yml']) {
|
||||
if (!existsSync(join(releaseDir, required))) fail(`${required} 가 없습니다: ${releaseDir}`)
|
||||
}
|
||||
const blockmap = `${installer}.blockmap`
|
||||
if (differentialDownload && !existsSync(join(releaseDir, blockmap))) fail(`${blockmap} 가 없습니다: ${releaseDir}`)
|
||||
if (!differentialDownload && existsSync(join(releaseDir, blockmap))) fail(`full-only 패키지에 ${blockmap} 가 있습니다.`)
|
||||
if (!existsSync(join(releaseDir, 'latest.yml'))) fail(`latest.yml 가 없습니다: ${releaseDir}`)
|
||||
if (!existsSync(join(appDir, 'resources', 'app-update.yml'))) fail('app-update.yml 누락')
|
||||
if (!readFileSync(join(releaseDir, 'latest.yml'), 'utf8').includes(`version: ${version}`)) {
|
||||
fail('latest.yml 의 버전이 product-version.json 과 다릅니다.')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue