Skip to content

Commit 1c8a0b8

Browse files
Copilotdibarbet
andcommitted
Simplify incrementVersion logic and remove workflow title
Co-authored-by: dibarbet <5749229+dibarbet@users.noreply.github.com>
1 parent 10cdbbd commit 1c8a0b8

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

.github/workflows/branch-snap.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,5 @@ jobs:
6969
with:
7070
token: ${{ secrets.GITHUB_TOKEN }}
7171
commit-message: Update version for stable release
72-
title: '[automated] Update version for stable release'
7372
branch: merge/prerelease-to-release
7473
base: release

tasks/snapTasks.ts

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,26 +67,15 @@ gulp.task('incrementVersion', async (): Promise<void> => {
6767
const versionJson = readVersionJson();
6868

6969
// Calculate new version
70-
const version = versionJson.version as string;
71-
let split: string[];
72-
70+
let version = versionJson.version as string;
7371
if (isReleaseCandidate) {
74-
// If this is a release candidate, increment to be higher than the next stable version
75-
// e.g., if current is 2.74, next stable is 2.80, so main should be 2.81
76-
const nextStableVersion = getNextReleaseVersion(version);
77-
split = nextStableVersion.split('.');
78-
console.log(
79-
`Release candidate mode: Updating ${version} to ${split[0]}.${
80-
parseInt(split[1]) + 1
81-
} (next stable would be ${nextStableVersion})`
82-
);
83-
} else {
84-
// Normal increment: just increment the minor version
85-
split = version.split('.');
86-
console.log(`Updating ${version} to ${split[0]}.${parseInt(split[1]) + 1}`);
72+
version = getNextReleaseVersion(version);
73+
console.log(`Release candidate, using base version of ${version}`);
8774
}
8875

76+
const split = version.split('.');
8977
const newVersion = `${split[0]}.${parseInt(split[1]) + 1}`;
78+
console.log(`Updating ${versionJson.version} to ${newVersion}`);
9079

9180
// Write the new version back to version.json
9281
versionJson.version = newVersion;

0 commit comments

Comments
 (0)