Skip to content

Commit 3dacfcb

Browse files
authored
Merge pull request #327 from UiPath/feat/commit-bump-version
chore: add automatic commit for bump version - OR-65046
2 parents 6296bf7 + c5910cf commit 3dacfcb

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

version-bump.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,24 @@ if (rcType && !allowedRcBumps.includes(rcType)) {
1919
}
2020

2121
if (bumpType !== 'fix-changelog-order') {
22-
changeLog(bumpVersion());
22+
bumpAndTagVersion();
2323
} else {
2424
fixChangelogOrder();
2525
}
2626

27+
function bumpAndTagVersion() {
28+
const [initialVersion, bumpedVersion] = bumpVersion();
29+
changeLog([initialVersion, bumpedVersion]);
30+
31+
execSync('git reset HEAD -- .');
32+
33+
execSync('git add package.json package-lock.json CHANGELOG.md projects/angular/package.json');
34+
35+
execSync(`git commit -m "chore: bump version to v${bumpedVersion}"`);
36+
37+
execSync(`git tag v${bumpedVersion}`);
38+
}
39+
2740

2841
function bumpVersion() {
2942
const content = fs.readFileSync('./package.json', 'utf-8');
@@ -63,8 +76,6 @@ function bumpVersion() {
6376

6477
fs.writeFileSync('./package-lock.json', updatedPackageLock);
6578

66-
execSync(`git tag v${bumpedVersion}`);
67-
6879
return [initialVersion, bumpedVersion];
6980
}
7081

0 commit comments

Comments
 (0)