Skip to content

Commit

Permalink
Prompt to include UMD build artifact links in GitHub release (#14864)
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Feb 15, 2019
1 parent fad0842 commit 0e67969
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions scripts/release/publish-commands/print-follow-up-instructions.js
Expand Up @@ -3,7 +3,9 @@
'use strict';

const clear = require('clear');
const {existsSync} = require('fs');
const {readJsonSync} = require('fs-extra');
const {join} = require('path');
const theme = require('../theme');

const run = async ({cwd, packages, tags}) => {
Expand All @@ -25,6 +27,8 @@ const run = async ({cwd, packages, tags}) => {
theme`{header A canary release} {version ${version}} {header has been published!}`
);
} else {
const nodeModulesPath = join(cwd, 'build/node_modules');

console.log(
theme.caution`The release has been published but you're not done yet!`
);
Expand Down Expand Up @@ -78,14 +82,28 @@ const run = async ({cwd, packages, tags}) => {
console.log(theme.command` git push origin --tags`);

console.log();
console.log(
theme.header`Lastly, please fill in the release on GitHub. ` +
theme`Don't forget to attach build artifacts from {path build/node_modules/}`
);
console.log(theme.header`Lastly, please fill in the release on GitHub.`);
console.log(
theme.link`https://github.com/facebook/react/releases/tag/v%s`,
version
);
console.log(
theme`\nThe GitHub release should also include links to the following artifacts:`
);
for (let i = 0; i < packages.length; i++) {
const packageName = packages[i];
if (existsSync(join(nodeModulesPath, packageName, 'umd'))) {
const {version: packageVersion} = readJsonSync(
join(nodeModulesPath, packageName, 'package.json')
);
console.log(
theme`{path • %s:} {link https://unpkg.com/%s@%s/umd/}`,
packageName,
packageName,
packageVersion
);
}
}
console.log();
}
};
Expand Down

0 comments on commit 0e67969

Please sign in to comment.