mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Updated release script to be Workflow aware (#15809)
This commit is contained in:
@@ -16,9 +16,22 @@ const run = async ({build, cwd}) => {
|
||||
process.env.CIRCLE_CI_API_TOKEN
|
||||
}`;
|
||||
const metadata = await http.get(metadataURL, true);
|
||||
const nodeModulesURL = metadata.find(
|
||||
const nodeModulesArtifact = metadata.find(
|
||||
entry => entry.path === 'home/circleci/project/node_modules.tgz'
|
||||
).url;
|
||||
);
|
||||
|
||||
if (!nodeModulesArtifact) {
|
||||
console.log(
|
||||
theme`{error The specified build number does not contain any build artifacts}\n\n` +
|
||||
'To get the correct build number from Circle CI, open the following URL:\n' +
|
||||
theme`{link https://circleci.com/gh/facebook/react/${build}}\n\n` +
|
||||
'Select the "commit" Workflow at the top of the page, then select the "process_artifacts" job.'
|
||||
);
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const nodeModulesURL = nodeModulesArtifact.url;
|
||||
|
||||
if (!existsSync(join(cwd, 'build'))) {
|
||||
await exec(`mkdir ./build`, {cwd});
|
||||
|
||||
@@ -10,7 +10,10 @@ const run = async () => {
|
||||
const metadataURL = `https://circleci.com/api/v1.1/project/github/facebook/react/tree/master`;
|
||||
const metadata = await http.get(metadataURL, true);
|
||||
const build = metadata.find(
|
||||
entry => entry.branch === 'master' && entry.status === 'success'
|
||||
entry =>
|
||||
entry.branch === 'master' &&
|
||||
entry.status === 'success' &&
|
||||
entry.workflows.job_name === 'process_artifacts'
|
||||
).build_num;
|
||||
|
||||
return build;
|
||||
|
||||
Reference in New Issue
Block a user