Skip to content

Commit

Permalink
chore(ui-scripts): use unix timestamp for pr release versions
Browse files Browse the repository at this point in the history
  • Loading branch information
balzss committed Feb 28, 2024
1 parent 8c19dbe commit f7f4fc3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/ui-scripts/lib/commands/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,20 @@ function calculateNextSnapshotVersion(version, prRelease) {

// we have to decrease the commitCount by 1 because the snapshots are
// zero based
const snapshotVersion = `${semver.inc(version, 'patch')}-${
prRelease ? 'pr-' : ''
}snapshot-${Number(commitCount) - 1}`
const snapshotVersion = `${semver.inc(version, 'patch')}-snapshot-${
Number(commitCount) - 1
}`

info(`next snapshot version is: ${snapshotVersion}`)
if (prRelease) {
const prSnapshotVersion = `${semver.inc(
version,
'patch'
)}-pr-snapshot-${Date.now()}`
info(`PR snapshot version is: ${prSnapshotVersion}`)
return prSnapshotVersion
}

info(`next snapshot version is: ${snapshotVersion}`)
return snapshotVersion
}

Expand Down

0 comments on commit f7f4fc3

Please sign in to comment.