fix(ci): keep binary source explicit and Python logs in UTF-8

This commit is contained in:
Agent Workbench Dev
2026-11-07 22:17:31 +08:00
parent 0b4f1de439
commit 36c6be4ff8
6 changed files with 37 additions and 10 deletions
+6
View File
@@ -8,6 +8,12 @@ import { readSourceZip } from './package-source.mjs';
export const digest = bytes => createHash('sha256').update(bytes).digest('hex');
export const fileDigest = file => digest(fs.readFileSync(file));
export const writeNewJson = (file, value) => fs.writeFileSync(file, JSON.stringify(value, null, 2) + '\n', { flag: 'wx' });
export function binaryMirror(value) {
if (!value) return null;
const url = new URL(value);
assert.ok(url.protocol === 'https:' && !url.username && !url.password && !url.search && !url.hash && url.pathname.endsWith('/'), 'Binary mirror must be an explicit HTTPS directory without credentials.');
return url.href;
}
export function createCiRun(outputRoot, profile) {
assert.ok(['contract', 'windows'].includes(profile), 'Unknown CI profile');
const root = path.resolve(outputRoot), run = path.join(root, `run-${profile}-${Date.now().toString(36)}-${randomUUID().slice(0,8)}`);