We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6b33a2 commit a3128b3Copy full SHA for a3128b3
2 files changed
AquaMai
Packaging/Build.ps1
@@ -20,15 +20,16 @@ try {
20
$gitDescribe = git describe --tags --long
21
Pop-Location
22
23
- if ($gitDescribe -match "v?(\d+\.\d+\.\d+)-(\d+)-g[0-9a-f]+") {
+ if ($gitDescribe -match "v?(\d+\.\d+(?:\.\d+)?)-(\d+)-g[0-9a-f]+") {
24
$baseVer = $Matches[1]
25
$commitCount = $Matches[2]
26
27
+ $baseVerFull = if ($baseVer.Split('.').Length -eq 2) { "$baseVer.0" } else { $baseVer }
28
+
29
if ($Mode -eq "Canary") {
- $BuildVersion = "$baseVer.$commitCount"
30
+ $BuildVersion = "$baseVerFull.$commitCount"
31
} else {
- # Release 模式保留三位 (补0)
- $BuildVersion = "$baseVer.0"
32
+ $BuildVersion = "$baseVerFull.0"
33
}
34
35
Write-Warning "Git describe format mismatch: $gitDescribe. Fallback to $BuildVersion"
0 commit comments