Don't prompt to tag or create GitHub release for canary releases (#14376)
Brian Vaughn committed
Dec 3, 2018 at 09:16 UTC
e382b0ba954688f1bc37e3fc776ceece2c04afd3
3 files changed
+59
-50
scripts/release/publish-commands/confirm-version-and-tags.js
+2
@@ -39,6 +39,8 @@ const run = async ({cwd, packages, tags}) => {
39
}
40
41
await confirm('Do you want to proceed?');
42
+
43
+ clear();
44
};
45
46
// Run this directly because it's fast,
scripts/release/publish-commands/print-follow-up-instructions.js
+54
-50
@@ -20,65 +20,69 @@ const run = async ({cwd, packages, tags}) => {
20
21
clear();
22
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 {
26
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!`
28
);
29
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();
32
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.`
34
);
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
+ }
57
}
54
- }
58
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
+ );
63
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`);
77
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
+ }
86
};
87
88
module.exports = run;
scripts/release/publish-commands/publish-to-npm.js
+3
@@ -3,12 +3,15 @@
3
'use strict';
4
5
const {exec} = require('child-process-promise');
6
+const clear = require('clear');
7
const {readJsonSync} = require('fs-extra');
8
const {join} = require('path');
9
const {confirm, execRead} = require('../utils');
10
const theme = require('../theme');
11
12
const run = async ({cwd, dry, packages, tags}, otp) => {
13
+ clear();
14
+
15
for (let i = 0; i < packages.length; i++) {
16
const packageName = packages[i];
17
const packagePath = join(cwd, 'build/node_modules', packageName);