Skip to content

Commit

Permalink
Sync scripts\make-version.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
SyncFileContents authored and SyncFileContents committed Jan 10, 2025
1 parent b6c2250 commit 31578ab
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/make-version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ param (
[string]$github_sha = "" # SHA of the commit
)

Set-PSDebug -Trace 1

# find the last version that was released
$LAST_TAG = (git tag --list --sort=-v:refname)[0]
$ALL_TAGS = git tag --list --sort=-v:refname
if ($null -eq $ALL_TAGS) {
$LAST_TAG = 'v1.0.0-pre.0'
} else {
$LAST_TAG = $ALL_TAGS[0]
}
$LAST_VERSION = $LAST_TAG -replace 'v', ''
$IS_PRERELEASE = $LAST_VERSION.Contains('-')

$LAST_VERSION = $LAST_VERSION -replace '-alpha', ''
$LAST_VERSION = $LAST_VERSION -replace '-beta', ''
$LAST_VERSION = $LAST_VERSION -replace '-rc', ''
$LAST_VERSION = $LAST_VERSION -replace '-pre', ''
if ($LAST_VERSION -eq '') {
$LAST_VERSION = '1.0.0-pre.0'
}

$LAST_VERSION_COMPONENTS = $LAST_VERSION -split '\.'
$LAST_VERSION_MAJOR = [int]$LAST_VERSION_COMPONENTS[0]
$LAST_VERSION_MINOR = [int]$LAST_VERSION_COMPONENTS[1]
Expand Down

0 comments on commit 31578ab

Please sign in to comment.