Skip to content

Commit

Permalink
Change lerna release config to allow version update in release branch…
Browse files Browse the repository at this point in the history
…es (#3878)

* fix: config lerna to allow release versioning in release branches

* fix: commit changelog in a separate commit for clarity

* fix: typo

* fix: typo 2
  • Loading branch information
jag-j authored Mar 3, 2022
1 parent fee3a51 commit b0a4d55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@
"docs",
"packages/*"
],
"version": "54.2.0"
"version": "54.2.0",
"command": {
"version": {
"allowBranch": [
"develop",
"release/*"
]
}
}
}
5 changes: 4 additions & 1 deletion scripts/create-release-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,17 @@ const groupedMessages = changeLogGeneratorUtils.getMessagesGroupedByPackage(pars
const changeLog = changeLogGeneratorUtils.getChangeLogText(releaseBranchName, groupedMessages);
changeLogGeneratorUtils.writeChangeLog(changeLog);

const commitCommand = `git commit -a -m "chore: generated CHANGELOG for ${releaseBranchName}"`;
shell.exec(commitCommand);

// git clean but keeping node_modules around
shell.exec('git clean -xfd -e node_modules');

// lerna version
// increment the version number in all packages without publishing to npmjs
// only run on branch named develop and do not create git tags
shell.exec(
`lerna version ${nextVersion} --force-publish --allow-branch develop --no-git-tag-version --exact --yes`
`lerna version ${nextVersion} --force-publish --no-git-tag-version --exact --yes`
);

// Using --no-git-tag-version prevents creating git tags but also prevents commiting
Expand Down

0 comments on commit b0a4d55

Please sign in to comment.