Skip to content

Commit 4c725a9

Browse files
author
Sean
authored
build(actions): correct nightly build version
The nightly build is using the wrong beta version. It's increasing the build version continuing from the past beta release instead of starting from 0 for a new version. Closes fomantic#1171
1 parent 662c43f commit 4c725a9

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

scripts/nightly-version.js

+12-9
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,21 @@ const getNpmPreRelease = async function () {
3737

3838
const getNightlyVersion = async function () {
3939
const nextVersion = await getGitHubVersion()
40-
const currentNightly = await getCurrentNpmVersion()
40+
const currentNightlyWithPre = semver.parse(await getCurrentNpmVersion())
41+
const currentNightly = `${currentNightlyWithPre.major}.${currentNightlyWithPre.minor}.${currentNightlyWithPre.patch}`
4142

42-
if (semver.minor(nextVersion) === semver.minor(currentNightly)) {
43-
const preRelease = await getNpmPreRelease()
43+
if (!semver.gt(nextVersion, currentNightly)) {
44+
if (semver.minor(nextVersion) === semver.minor(currentNightly)) {
45+
const preRelease = await getNpmPreRelease()
4446

45-
return semver.inc(
46-
`${nextVersion}-${preRelease[0]}.${preRelease[1]}`,
47-
'prerelease'
48-
)
49-
} else {
50-
return `${nextVersion}-beta.1`
47+
return semver.inc(
48+
`${nextVersion}-${preRelease[0]}.${preRelease[1]}`,
49+
'prerelease'
50+
)
51+
}
5152
}
53+
54+
return `${nextVersion}-beta.0`
5255
}
5356

5457
getNightlyVersion()

0 commit comments

Comments
 (0)