Skip to content

Commit e382b0b

Browse files
authored
Don't prompt to tag or create GitHub release for canary releases (#14376)
1 parent 8482cbe commit e382b0b

File tree

3 files changed

+59
-50
lines changed

3 files changed

+59
-50
lines changed

scripts/release/publish-commands/confirm-version-and-tags.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const run = async ({cwd, packages, tags}) => {
3939
}
4040

4141
await confirm('Do you want to proceed?');
42+
43+
clear();
4244
};
4345

4446
// Run this directly because it's fast,

scripts/release/publish-commands/print-follow-up-instructions.js

Lines changed: 54 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -20,65 +20,69 @@ const run = async ({cwd, packages, tags}) => {
2020

2121
clear();
2222

23-
console.log(
24-
theme.caution`The release has been published but you're not done yet!`
25-
);
26-
27-
if (tags.includes('latest')) {
28-
console.log();
23+
if (tags.length === 1 && tags[0] === 'canary') {
24+
console.log(theme.header`A canary release has been pulbished!`);
25+
} else {
2926
console.log(
30-
theme.header`Please review and commit all local, staged changes.`
27+
theme.caution`The release has been published but you're not done yet!`
3128
);
3229

33-
console.log();
34-
console.log('Version numbers have been updated in the following files:');
35-
for (let i = 0; i < packages.length; i++) {
36-
const packageName = packages[i];
37-
console.log(theme.path`• packages/%s/package.json`, packageName);
38-
}
39-
console.log(theme.path`• packages/shared/ReactVersion.js`);
40-
41-
console.log();
42-
if (environment === 'ci') {
43-
console.log('Auto-generated error codes have been updated as well:');
44-
console.log(theme.path`• scripts/error-codes/codes.json`);
45-
} else {
30+
if (tags.includes('latest')) {
31+
console.log();
4632
console.log(
47-
theme`{caution The release that was just published was created locally.} ` +
48-
theme`Because of this, you will need to update the generated ` +
49-
theme`{path scripts/error-codes/codes.json} file manually:`
33+
theme.header`Please review and commit all local, staged changes.`
5034
);
51-
console.log(theme` {command git checkout} {version ${commit}}`);
52-
console.log(theme` {command yarn build -- --extract-errors}`);
35+
36+
console.log();
37+
console.log('Version numbers have been updated in the following files:');
38+
for (let i = 0; i < packages.length; i++) {
39+
const packageName = packages[i];
40+
console.log(theme.path`• packages/%s/package.json`, packageName);
41+
}
42+
console.log(theme.path`• packages/shared/ReactVersion.js`);
43+
44+
console.log();
45+
if (environment === 'ci') {
46+
console.log('Auto-generated error codes have been updated as well:');
47+
console.log(theme.path`• scripts/error-codes/codes.json`);
48+
} else {
49+
console.log(
50+
theme`{caution The release that was just published was created locally.} ` +
51+
theme`Because of this, you will need to update the generated ` +
52+
theme`{path scripts/error-codes/codes.json} file manually:`
53+
);
54+
console.log(theme` {command git checkout} {version ${commit}}`);
55+
console.log(theme` {command yarn build -- --extract-errors}`);
56+
}
5357
}
54-
}
5558

56-
console.log();
57-
console.log(
58-
theme`{header Don't forget to update and commit the }{path CHANGELOG}`
59-
);
59+
console.log();
60+
console.log(
61+
theme`{header Don't forget to update and commit the }{path CHANGELOG}`
62+
);
6063

61-
// Prompt the release engineer to tag the commit and update the CHANGELOG.
62-
// (The script could automatically do this, but this seems safer.)
63-
console.log();
64-
console.log(
65-
theme.header`Tag the source for this release in Git with the following command:`
66-
);
67-
console.log(
68-
theme` {command git tag -a v}{version %s} {command -m "v%s"} {version %s}`,
69-
version,
70-
version,
71-
commit
72-
);
73-
console.log(theme.command` git push origin --tags`);
64+
// Prompt the release engineer to tag the commit and update the CHANGELOG.
65+
// (The script could automatically do this, but this seems safer.)
66+
console.log();
67+
console.log(
68+
theme.header`Tag the source for this release in Git with the following command:`
69+
);
70+
console.log(
71+
theme` {command git tag -a v}{version %s} {command -m "v%s"} {version %s}`,
72+
version,
73+
version,
74+
commit
75+
);
76+
console.log(theme.command` git push origin --tags`);
7477

75-
console.log();
76-
console.log(theme.header`Lastly, please fill in the release on GitHub:`);
77-
console.log(
78-
theme.link`https://github.com/facebook/react/releases/tag/v%s`,
79-
version
80-
);
81-
console.log();
78+
console.log();
79+
console.log(theme.header`Lastly, please fill in the release on GitHub:`);
80+
console.log(
81+
theme.link`https://github.com/facebook/react/releases/tag/v%s`,
82+
version
83+
);
84+
console.log();
85+
}
8286
};
8387

8488
module.exports = run;

scripts/release/publish-commands/publish-to-npm.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
'use strict';
44

55
const {exec} = require('child-process-promise');
6+
const clear = require('clear');
67
const {readJsonSync} = require('fs-extra');
78
const {join} = require('path');
89
const {confirm, execRead} = require('../utils');
910
const theme = require('../theme');
1011

1112
const run = async ({cwd, dry, packages, tags}, otp) => {
13+
clear();
14+
1215
for (let i = 0; i < packages.length; i++) {
1316
const packageName = packages[i];
1417
const packagePath = join(cwd, 'build/node_modules', packageName);

0 commit comments

Comments
 (0)