Skip to content

Commit

Permalink
build(actions): correct nightly build version
Browse files Browse the repository at this point in the history
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 #1171
  • Loading branch information
Sean Hamilton committed Nov 14, 2019
1 parent 662c43f commit 87521aa
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions scripts/nightly-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,24 @@ const getNpmPreRelease = async function () {

const getNightlyVersion = async function () {
const nextVersion = await getGitHubVersion()
const currentNightly = await getCurrentNpmVersion()
const currentNightlyWithPre = semver.parse(await getCurrentNpmVersion())
const currentNightly = `${currentNightlyWithPre.major}.${currentNightlyWithPre.minor}.${currentNightlyWithPre.patch}`

if (semver.minor(nextVersion) === semver.minor(currentNightly)) {
const preRelease = await getNpmPreRelease()
console.log('nextVersion ', nextVersion);
console.log('currentNightly ', currentNightly);

return semver.inc(
`${nextVersion}-${preRelease[0]}.${preRelease[1]}`,
'prerelease'
)
} else {
return `${nextVersion}-beta.1`
if (!semver.gt(nextVersion, currentNightly)) {
if (semver.minor(nextVersion) === semver.minor(currentNightly)) {
const preRelease = await getNpmPreRelease()

return semver.inc(
`${nextVersion}-${preRelease[0]}.${preRelease[1]}`,
'prerelease'
)
}
}

return `${nextVersion}-beta.0`
}

getNightlyVersion()
Expand Down

0 comments on commit 87521aa

Please sign in to comment.