test action
This commit is contained in:
@@ -46,7 +46,20 @@ jobs:
|
||||
- name: Get current version
|
||||
id: get_version
|
||||
run: |
|
||||
$version = (Get-Content "Ink Canvas\Properties\AssemblyInfo.cs" | Select-String "AssemblyVersion\(""([^""]+)""\)").Matches[0].Groups[1].Value
|
||||
$versionLine = Get-Content "Ink Canvas\Properties\AssemblyInfo.cs" | Select-String "AssemblyVersion\(""([^""]+)""\)"
|
||||
if ($versionLine) {
|
||||
$version = $versionLine.Matches[0].Groups[1].Value
|
||||
# 处理通配符版本号
|
||||
if ($version -match "(\d+)\.(\d+)\.(\*|\d+)\.(\*|\d+)") {
|
||||
$major = $matches[1]
|
||||
$minor = $matches[2]
|
||||
$patch = if ($matches[3] -eq "*") { "0" } else { $matches[3] }
|
||||
$revision = if ($matches[4] -eq "*") { "0" } else { $matches[4] }
|
||||
$version = "$major.$minor.$patch.$revision"
|
||||
}
|
||||
} else {
|
||||
$version = "1.0.0.0"
|
||||
}
|
||||
echo "current_version=$version" >> $env:GITHUB_OUTPUT
|
||||
echo "Current version: $version"
|
||||
|
||||
@@ -55,9 +68,17 @@ jobs:
|
||||
run: |
|
||||
$currentVersion = "${{ steps.get_version.outputs.current_version }}"
|
||||
$versionParts = $currentVersion.Split('.')
|
||||
$major = [int]$versionParts[0]
|
||||
$minor = [int]$versionParts[1]
|
||||
$patch = [int]$versionParts[2]
|
||||
|
||||
# 确保版本号格式正确
|
||||
if ($versionParts.Length -ge 3) {
|
||||
$major = [int]$versionParts[0]
|
||||
$minor = [int]$versionParts[1]
|
||||
$patch = [int]$versionParts[2]
|
||||
} else {
|
||||
$major = 1
|
||||
$minor = 0
|
||||
$patch = 0
|
||||
}
|
||||
|
||||
$versionType = "${{ github.event.inputs.version_type }}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user