GoodBuddy Agents / Validate Agent source (push) Canceled after 0s
GoodBuddy Agents / Build darwin arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux arm64 Agent (push) Canceled after 0s
GoodBuddy Agents / Build linux x64 Agent (push) Canceled after 0s
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s
Preserve npm relative symlinks while preparing the desktop DS Web resources. The previous copy rewrote CLI links to build-machine absolute paths, causing both macOS targets to fail strict code-signature verification. The regression runs the production preparation and builder matcher, removes the installation and staging trees, and verifies the final link remains readable. Recover the unpublished Desktop 0.15.0 as 0.15.1 without moving its tag. Agent stays 0.15.0 and requires Desktop 0.15.1. Carry the unpublished notes forward once and align the bilingual feature matrices and upgrade guidance. Validation: complete frozen Linux tree 5372 passed, 51 skipped; Windows packaging checks 45 passed and one POSIX-only test skipped. Typecheck, lint, and bilingual release-note validation passed. Native macOS signing remains an independent release check. Agent Runtime implementations are unaffected. Release note: 修复本地 DS Web 随包依赖的链接复制,避免 macOS 安装包签名校验失败。
83 lines
4.6 KiB
TypeScript
83 lines
4.6 KiB
TypeScript
import { mkdirSync, mkdtempSync, readFileSync, readlinkSync, rmSync, symlinkSync, writeFileSync } from 'node:fs'
|
|
import { createRequire } from 'node:module'
|
|
import { tmpdir } from 'node:os'
|
|
import { dirname, join, resolve } from 'node:path'
|
|
import { expect, it } from 'vitest'
|
|
|
|
const require = createRequire(import.meta.url)
|
|
const { getFileMatchers, copyFiles } = require('app-builder-lib/out/fileMatcher')
|
|
const { prepareNativeDshResources } = require('../build/native-dsh-resources.cjs')
|
|
|
|
it('copies DS dependencies and nested assets through the actual builder matcher', async () => {
|
|
const root = mkdtempSync(join(tmpdir(), 'goodbuddy-dsh-packaging-'))
|
|
const config = JSON.parse(readFileSync(resolve('package.json'), 'utf8'))
|
|
const resource = config.build.extraResources.find((entry: { to: string }) => entry.to.startsWith('runtimes/dsh'))
|
|
const files = ['@deepseek-ai/dsh/lib/bin.js', '@deepseek-ai/dsh/node_modules/example/index.js', '@deepseek-ai/dsh-web/dist/index.html']
|
|
try {
|
|
for (const file of files) {
|
|
const source = join(root, '.runtime-resources/dsh-x64/node_modules', file)
|
|
mkdirSync(dirname(source), { recursive: true })
|
|
writeFileSync(source, file)
|
|
}
|
|
const destination = join(root, 'output/resources')
|
|
const matchers = getFileMatchers({ extraResources: [resource] }, 'extraResources', destination, {
|
|
defaultSrc: root,
|
|
globalOutDir: join(root, 'output'),
|
|
customBuildOptions: {},
|
|
macroExpander: (value: string) => value.replaceAll('${arch}', 'x64')
|
|
})
|
|
await copyFiles(matchers)
|
|
for (const file of files) {
|
|
expect(readFileSync(join(destination, 'runtimes/dsh/node_modules', file), 'utf8')).toBe(file)
|
|
}
|
|
} finally {
|
|
rmSync(root, { recursive: true, force: true })
|
|
}
|
|
})
|
|
|
|
it.skipIf(process.platform === 'win32')('keeps npm CLI symlinks inside the relocated DS bundle', async () => {
|
|
const root = mkdtempSync(join(tmpdir(), 'goodbuddy-dsh-symlinks-'))
|
|
const write = (file: string, value: unknown): void => {
|
|
const target = join(root, file)
|
|
mkdirSync(dirname(target), { recursive: true })
|
|
writeFileSync(target, JSON.stringify(value))
|
|
}
|
|
try {
|
|
write('node_modules/@deepseek-ai/dsh/package.json', { name: '@deepseek-ai/dsh', dependencies: {
|
|
child: '1.0.0', sharp: '1.0.0', '@koromix/koffi-linux-x64': '1.0.0'
|
|
} })
|
|
write('node_modules/@deepseek-ai/dsh/node_modules/child/package.json', { name: 'child', version: '1.0.0' })
|
|
write('node_modules/@deepseek-ai/dsh/node_modules/child/bin.js', 'fixture')
|
|
const sourceBin = join(root, 'node_modules/@deepseek-ai/dsh/node_modules/.bin')
|
|
mkdirSync(sourceBin, { recursive: true })
|
|
symlinkSync('../child/bin.js', join(sourceBin, 'child'))
|
|
write('node_modules/sharp/package.json', { optionalDependencies: {
|
|
'@img/sharp-linux-x64': '1.0.0', '@img/sharp-libvips-linux-x64': '1.0.0'
|
|
} })
|
|
write('node_modules/sharp/node_modules/@img/sharp-linux-x64/package.json', { version: '1.0.0' })
|
|
write('node_modules/sharp/node_modules/@img/sharp-libvips-linux-x64/package.json', { version: '1.0.0' })
|
|
write('node_modules/@koromix/koffi-linux-x64/package.json', { version: '1.0.0' })
|
|
write('node_modules/koffi/package.json', { version: '1.0.0' })
|
|
write('package-lock.json', { packages: {} })
|
|
const unexpectedDownload = (): never => { throw new Error('Fixture must not download native packages') }
|
|
await prepareNativeDshResources(root, 'linux', 'x64', unexpectedDownload, unexpectedDownload)
|
|
const link = 'node_modules/@deepseek-ai/dsh/node_modules/.bin/child'
|
|
expect(readlinkSync(join(root, '.runtime-resources/dsh-x64', link))).toBe('../child/bin.js')
|
|
const config = JSON.parse(readFileSync(resolve('package.json'), 'utf8'))
|
|
const resource = config.build.extraResources.find((entry: { to: string }) => entry.to.startsWith('runtimes/dsh'))
|
|
const destination = join(root, 'output/resources')
|
|
await copyFiles(getFileMatchers({ extraResources: [resource] }, 'extraResources', destination, {
|
|
defaultSrc: root, globalOutDir: join(root, 'output'), customBuildOptions: {},
|
|
macroExpander: (value: string) => value.replaceAll('${arch}', 'x64')
|
|
}))
|
|
// No original installation or staging directory may be needed after shipping.
|
|
rmSync(join(root, 'node_modules'), { recursive: true, force: true })
|
|
rmSync(join(root, '.runtime-resources'), { recursive: true, force: true })
|
|
const packagedLink = join(destination, 'runtimes/dsh', link)
|
|
expect(readlinkSync(packagedLink)).toBe('../child/bin.js')
|
|
expect(readFileSync(packagedLink, 'utf8')).toBe(JSON.stringify('fixture'))
|
|
} finally {
|
|
rmSync(root, { recursive: true, force: true })
|
|
}
|
|
})
|