Skip to content

Commit a3128b3

Browse files
committed
feat: 支持两段版本号
1 parent b6b33a2 commit a3128b3

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

AquaMai

Packaging/Build.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ try {
2020
$gitDescribe = git describe --tags --long
2121
Pop-Location
2222

23-
if ($gitDescribe -match "v?(\d+\.\d+\.\d+)-(\d+)-g[0-9a-f]+") {
23+
if ($gitDescribe -match "v?(\d+\.\d+(?:\.\d+)?)-(\d+)-g[0-9a-f]+") {
2424
$baseVer = $Matches[1]
2525
$commitCount = $Matches[2]
2626

27+
$baseVerFull = if ($baseVer.Split('.').Length -eq 2) { "$baseVer.0" } else { $baseVer }
28+
2729
if ($Mode -eq "Canary") {
28-
$BuildVersion = "$baseVer.$commitCount"
30+
$BuildVersion = "$baseVerFull.$commitCount"
2931
} else {
30-
# Release 模式保留三位 (补0)
31-
$BuildVersion = "$baseVer.0"
32+
$BuildVersion = "$baseVerFull.0"
3233
}
3334
} else {
3435
Write-Warning "Git describe format mismatch: $gitDescribe. Fallback to $BuildVersion"

0 commit comments

Comments
 (0)