Skip to content

Commit

Permalink
moved No interface changes sanity check to release script
Browse files Browse the repository at this point in the history
  • Loading branch information
chandlerprall committed Jun 22, 2018
1 parent 949255f commit 18d512b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 13 additions & 7 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ const humanReadableTypes = {

(async function () {
// ensure git is on the master branch
// await ensureMasterBranch();
await ensureMasterBranch();

// run linting and unit tests
// execSync('npm test', execOptions);
execSync('npm test', execOptions);

// (trans|com)pile `src` into `lib` and `dist`
// execSync('npm run build', execOptions);
execSync('npm run build', execOptions);

// prompt user for what type of version bump to make (major|minor|patch)
const versionTarget = await getVersionTypeFromChangelog();

// update package.json & package-lock.json version, git commit, git tag
execSync(`npm --no-git-tag-version version ${versionTarget}`, execOptions);
execSync(`npm version ${versionTarget}`, execOptions);

// push the version commit & tag to upstream
// execSync('git push upstream --tags', execOptions);
execSync('git push upstream --tags', execOptions);

// publish new version to npm
// execSync('npm publish', execOptions);
execSync('npm publish', execOptions);

// update docs, git commit, git push
// execSync('npm run sync-docs', execOptions);
execSync('npm run sync-docs', execOptions);
}()).catch(e => console.error(e));

async function ensureMasterBranch() {
Expand All @@ -60,6 +60,12 @@ async function getVersionTypeFromChangelog() {

const changelog = fs.readFileSync(pathToChangelog).toString();

// Sanity check, if the changelog contains "No public interface changes"then we shouldn't be releasing
if (changelog.indexOf('No public interface changes') !== -1) {
console.error(`Unable to release: CHANGELOG.md indicates "No public interface changes"`);
process.exit(1);
}

// get contents between the first two headings
// changelog headings always use ##, this matches:
//
Expand Down
6 changes: 0 additions & 6 deletions scripts/update-changelog-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ if (changelogContents.indexOf(masterHeading) !== 0) {
process.exit(1);
}

// sanity check, if there are "No public interface changes" then what are we releasing?
if (changelogContents.indexOf("No public interface changes") !== -1) {
console.error(`Cannot update CHANGELOG.md: "No public interface changes"`);
process.exit(1);
}

// Insert the changelog template after the master header
changelogContents = changelogContents.replace(
masterHeading,
Expand Down

0 comments on commit 18d512b

Please sign in to comment.