feat: 회의 파일 가져오기와 입력 엔진 배포 보완
This commit is contained in:
parent
5a8c5cd792
commit
b3519e5da7
54 changed files with 1129 additions and 116 deletions
|
|
@ -5,6 +5,8 @@
|
|||
// npm run release -- minor # 1.9.0 → 1.10.0 (feat)
|
||||
// npm run release -- 2.0.0 # 직접 지정
|
||||
// npm run release -- minor --dry-run # 무엇을 할지만 출력
|
||||
// node --env-file-if-exists=.env scripts/ci/release-desktop.mjs minor --with-runtime
|
||||
// — 새 사이드카/portable을 먼저 게시한 뒤 설치본을 게시한다.
|
||||
// npm run release -- --resume # 빌드/게시/푸시 중 실패했을 때 같은 버전으로 이어서
|
||||
//
|
||||
// 단계 (실패하면 거기서 멈추고, --resume 으로 이어 간다):
|
||||
|
|
@ -23,11 +25,13 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs'
|
|||
import { dirname, join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { loadSigningKey, publicPemOf } from './lib/update-manifest-signature.mjs'
|
||||
import { saveReleaseArtifacts, verifyReleaseArtifacts } from './lib/release-artifacts.mjs'
|
||||
|
||||
const root = join(dirname(fileURLToPath(import.meta.url)), '..', '..')
|
||||
const args = process.argv.slice(2)
|
||||
const dryRun = args.includes('--dry-run')
|
||||
const resume = args.includes('--resume')
|
||||
const withRuntime = args.includes('--with-runtime')
|
||||
const bumpArg = args.find((arg) => !arg.startsWith('--'))
|
||||
const CANONICAL_REMOTE = 'chanpaca'
|
||||
const MIRROR_REMOTES = ['origin']
|
||||
|
|
@ -81,6 +85,7 @@ if (resume) {
|
|||
if (dryRun) {
|
||||
info(notes ? `CHANGELOG 초안:\n${notes}` : 'CHANGELOG 섹션 있음')
|
||||
info('단계: 커밋·태그 → 빌드 → 푸시 → 게시(서명) → 공개 URL 검증')
|
||||
if (withRuntime) info('런타임 포함: 사이드카 재빌드 → portable/runtime 게시 → 설치본 게시')
|
||||
info('dry-run — 아무것도 바꾸지 않았습니다.')
|
||||
process.exit(0)
|
||||
}
|
||||
|
|
@ -105,7 +110,7 @@ if (resume) {
|
|||
runNpm(['run', 'version:check'])
|
||||
runNpm(['run', 'release:metadata'])
|
||||
runNpm(['run', 'typecheck'])
|
||||
// 여기까지 실패하면 버전 파일만 바뀐 상태다 — git checkout -- . 로 되돌리고 다시 실행.
|
||||
// 여기까지 실패하면 버전 파일이 바뀐 상태다. 변경과 실패 증거를 보존하고 원인을 복구한다.
|
||||
|
||||
// ── 4. 커밋 + 태그 ──
|
||||
step(`커밋 + 태그 ${tag}`)
|
||||
|
|
@ -116,18 +121,45 @@ if (resume) {
|
|||
|
||||
const tag = `v${version}`
|
||||
const tagCommit = git(['rev-parse', `${tag}^{commit}`])
|
||||
const releaseDir = join(root, 'apps', 'desktop', 'release', version)
|
||||
const artifactIdentity = { version, tagCommit, withRuntime }
|
||||
const hasCheckpoint = existsSync(join(releaseDir, 'release-artifacts.json'))
|
||||
|
||||
// 태그가 생긴 뒤의 실패는 --resume 으로 이어 간다.
|
||||
const resumeHint = '\n고친 뒤 이어 가기: npm run release -- --resume'
|
||||
const resumeHint = `\n고친 뒤 이어 가기: node --env-file-if-exists=.env scripts/ci/release-desktop.mjs --resume${withRuntime ? ' --with-runtime' : ''}`
|
||||
|
||||
// 이미 게시가 끝난 버전을 다시 빌드하면 바이트가 달라 불변 경로와 충돌한다 — 푸시만 남은 경우다.
|
||||
if (resume && (await feedHasVersion(version))) {
|
||||
if (resume && !hasCheckpoint && !withRuntime && (await feedHasVersion(version))) {
|
||||
info(`피드에 ${version} 가 이미 있습니다 — 빌드·게시를 건너뜁니다.`)
|
||||
pushToRemotes(tag, tagCommit)
|
||||
} else {
|
||||
// ── 5. 빌드 ──
|
||||
step('빌드')
|
||||
runNode('scripts/ci/build-desktop-installer.mjs', [], {}, resumeHint)
|
||||
if (resume && hasCheckpoint) {
|
||||
step('보존 산출물 검증')
|
||||
await verifyReleaseArtifacts(releaseDir, artifactIdentity)
|
||||
info('태그·해시가 일치하는 원본 산출물을 재사용합니다.')
|
||||
} else {
|
||||
if (existsSync(releaseDir)) {
|
||||
fail(`기존 산출물을 보존합니다: ${releaseDir}\n검증 가능한 release-artifacts.json이 없습니다. 원본 산출물을 조사·복구한 뒤 재개하세요.`)
|
||||
}
|
||||
step('빌드')
|
||||
runNode('scripts/ci/build-desktop-installer.mjs', [], {}, resumeHint)
|
||||
if (withRuntime) {
|
||||
runNpm(['run', 'sidecar:build', '--workspace=@d3ro/desktop'])
|
||||
runNode('scripts/ci/verify-sidecar-bundle.mjs', ['--smoke'], {}, resumeHint)
|
||||
runNode('scripts/ci/build-portable.mjs', ['--release-artifacts-only'], {}, resumeHint)
|
||||
}
|
||||
// 첫 업로드 전에 원본 바이트와 태그를 기록한다. 재개 시 재빌드하지 않는다.
|
||||
await saveReleaseArtifacts(releaseDir, artifactIdentity)
|
||||
}
|
||||
|
||||
// 런타임을 요구하는 앱을 먼저 게시하면 기존 사용자의 모델 로드가 막힌다.
|
||||
// 기존 portable 게시기는 부품 해시를 검증하고 runtime 인덱스를 마지막에 게시한다.
|
||||
if (withRuntime) {
|
||||
step('런타임 선행 게시')
|
||||
// 게시기는 동일 바이트를 건너뛰고 누락된 파일과 latest 별칭을 복구한다.
|
||||
runNode('scripts/ci/publish-portable-release.mjs', [], {}, resumeHint)
|
||||
}
|
||||
|
||||
// ── 6. 푸시 ──
|
||||
// Forgejo Release 생성 API(POST /releases)는 원격에 태그가 아직 없으면 target_commitish 에
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue