[release] Allow building single release channel with processed versions (#35270)

This commit is contained in:
Sebastian "Sebbie" Silbermann
2025-12-02 22:05:10 +01:00
committed by GitHub
parent 09f05694a2
commit 36df5e8b42
2 changed files with 27 additions and 18 deletions

View File

@@ -124,25 +124,34 @@ async function main() {
throw new Error(`Unknown release channel ${argv.releaseChannel}`);
}
} else {
// Running locally, no concurrency. Move each channel's build artifacts into
// a temporary directory so that they don't conflict.
buildForChannel('stable', '', '');
const stableDir = tmp.dirSync().name;
crossDeviceRenameSync('./build', stableDir);
processStable(stableDir);
buildForChannel('experimental', '', '');
const experimentalDir = tmp.dirSync().name;
crossDeviceRenameSync('./build', experimentalDir);
processExperimental(experimentalDir);
const releaseChannel = argv.releaseChannel;
if (releaseChannel === 'stable') {
buildForChannel('stable', '', '');
processStable('./build');
} else if (releaseChannel === 'experimental') {
buildForChannel('experimental', '', '');
processExperimental('./build');
} else {
// Running locally, no concurrency. Move each channel's build artifacts into
// a temporary directory so that they don't conflict.
buildForChannel('stable', '', '');
const stableDir = tmp.dirSync().name;
crossDeviceRenameSync('./build', stableDir);
processStable(stableDir);
buildForChannel('experimental', '', '');
const experimentalDir = tmp.dirSync().name;
crossDeviceRenameSync('./build', experimentalDir);
processExperimental(experimentalDir);
// Then merge the experimental folder into the stable one. processExperimental
// will have already removed conflicting files.
//
// In CI, merging is handled by the GitHub Download Artifacts plugin.
mergeDirsSync(experimentalDir + '/', stableDir + '/');
// Then merge the experimental folder into the stable one. processExperimental
// will have already removed conflicting files.
//
// In CI, merging is handled by the GitHub Download Artifacts plugin.
mergeDirsSync(experimentalDir + '/', stableDir + '/');
// Now restore the combined directory back to its original name
crossDeviceRenameSync(stableDir, './build');
// Now restore the combined directory back to its original name
crossDeviceRenameSync(stableDir, './build');
}
}
}