Files
goodbuddy/build/verify-site-release.cjs
T
mesalogo e5aebaa67d feat: add independent managed SSH agent packages
Managed SSH previously tied remote Agent and Runtime artifacts to desktop
packaging and Host activation. Settings now manages verified Linux x64 and
arm64 .gbagent packages explicitly, with source-aligned download and update
plus offline import and export. Each package contains the signed Agent, pinned
Node, and compatible OpenCode Runtime, and project activation never downloads
one automatically.

Dedicated native CI and a protected release workflow publish deterministic,
signed cumulative catalogs to GitHub and Beijing OSS without replacing the
desktop Latest release. Desktop packaging is metadata-only, remains independent
of Agent artifacts and signing credentials, and Linux desktop releases add RPM
installers.

The managed SSH path also keeps model credentials in Main, enforces Ask as
read-only, verifies signed Agent and Runtime inputs, preserves ACP recovery, and
reports Host update cancellation and failures accurately.

Release note: 远程项目现可在“设置”中手动下载、更新或离线导入签名 Agent 包,桌面安装包与远程组件发布相互独立;Linux 桌面版同时新增 RPM 安装包。
2026-08-25 18:28:29 +08:00

72 lines
2.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const { readFileSync } = require('node:fs')
const { resolve } = require('node:path')
const {
targetDefinitions
} = require('./aggregate-release.cjs')
const expectedInstallerCount = targetDefinitions.reduce(
(count, target) => count + target.formats.length,
0
)
function parseArguments(argv) {
if (argv.length !== 2 || argv[0] !== '--manifest' || !argv[1]) {
throw new Error('必须指定 --manifest')
}
return { manifest: resolve(argv[1]) }
}
async function verifySiteRelease(manifest, request = fetch) {
const files = Object.values(manifest?.targets ?? {}).flatMap(
(target) => Object.values(target?.files ?? {})
)
if (files.length !== expectedInstallerCount) {
throw new Error(`官网发布文件数量错误:${files.length}`)
}
const urls = new Set()
for (const file of files) {
if (
typeof file?.url !== 'string' ||
!Number.isSafeInteger(file.size) ||
file.size < 1 ||
urls.has(file.url)
) {
throw new Error('官网发布文件元数据无效')
}
urls.add(file.url)
const response = await request(file.url, {
method: 'HEAD',
redirect: 'error'
})
if (!response.ok) {
throw new Error(`OSS 文件不可访问:${file.url}(${response.status})`)
}
const contentLength = Number(response.headers.get('content-length'))
if (contentLength !== file.size) {
throw new Error(
`OSS 文件大小不匹配:${file.url},期望 ${file.size},实际 ${contentLength}`
)
}
}
return files.length
}
async function main(argv = process.argv.slice(2)) {
const options = parseArguments(argv)
const manifest = JSON.parse(readFileSync(options.manifest, 'utf8'))
const count = await verifySiteRelease(manifest)
console.log(`OSS 发布文件验证通过:${count} 个`)
}
module.exports = {
parseArguments,
verifySiteRelease
}
if (require.main === module) {
main().catch((error) => {
console.error(error)
process.exitCode = 1
})
}