Skip to content

Commit

Permalink
Prepare release without commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendavid committed Jun 15, 2021
1 parent 2727a1e commit a7aaa6d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@
"prepublish": "npm run build",
"prettier:rc": "prettier --write",
"prettier": "prettier --write .",
"release:major:nc": "node scripts.js prepare_release major --no-commit",
"release:major": "node scripts.js prepare_release major",
"release:minor:nc": "node scripts.js prepare_release minor --no-commit",
"release:minor": "node scripts.js prepare_release minor",
"release:patch:nc": "node scripts.js prepare_release patch --no-commit",
"release:patch": "node scripts.js prepare_release patch",
"test:e2e": "concurrently 'npm run test:serve' 'wait-on http://localhost:3000/esm.html && npm run cypress' --kill-others --success first",
"test:serve": "node tests/esm.server.js",
Expand Down
16 changes: 9 additions & 7 deletions scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ ${commits}
${changelog}`;
await fs.writeFile('CHANGELOG.md', changelog, { encoding: 'utf8' });
await exec('git add CHANGELOG.md');
await exec(
`git commit -m "[RELEASE] update changelog for v${newVersion}" --no-verify`
);
await exec(
`npm version --no-commit-hooks ${newVersion} -m '[RELEASE] v${newVersion}'`
);
if (!process.argv.includes('--no-commit')) {
await exec('git add CHANGELOG.md');
await exec(
`git commit -m "[RELEASE] update changelog for v${newVersion}" --no-verify`
);
await exec(
`npm version --no-commit-hooks ${newVersion} -m '[RELEASE] v${newVersion}'`
);
}
}

runScript().catch((err) => {
Expand Down

0 comments on commit a7aaa6d

Please sign in to comment.