fix(ci): keep binary source explicit and Python logs in UTF-8
This commit is contained in:
@@ -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)}`);
|
||||
|
||||
Reference in New Issue
Block a user