Skip to content

Commit 79ca840

Browse files
committed
ci: makes the version matching script more tolerant to different spacing
1 parent 4513261 commit 79ca840

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.azure-pipelines/ci-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ extends:
8383

8484
- pwsh: |
8585
$contents = Get-Content gradle.properties -Raw
86-
$major = $contents | Select-String -Pattern 'mavenMajorVersion = ([0-9]+)' | ForEach-Object { $_.Matches.Groups[1].Value }
87-
$minor = $contents | Select-String -Pattern 'mavenMinorVersion = ([0-9]+)' | ForEach-Object { $_.Matches.Groups[1].Value }
88-
$patch = $contents | Select-String -Pattern 'mavenPatchVersion = ([0-9]+)' | ForEach-Object { $_.Matches.Groups[1].Value }
86+
$major = $contents | Select-String -Pattern 'mavenMajorVersion\s*=\s*([0-9]+)' | ForEach-Object { $_.Matches.Groups[1].Value }
87+
$minor = $contents | Select-String -Pattern 'mavenMinorVersion\s*=\s*([0-9]+)' | ForEach-Object { $_.Matches.Groups[1].Value }
88+
$patch = $contents | Select-String -Pattern 'mavenPatchVersion\s*=\s*([0-9]+)' | ForEach-Object { $_.Matches.Groups[1].Value }
8989
# $snapshot_suffix = if ($Env:BRANCH_NAME.StartsWith('refs/tags/v')) { '' } else { '-SNAPSHOT' }
9090
$version = "$major.$minor.$patch$snapshot_suffix"
9191
echo "Current version is $version"

0 commit comments

Comments
 (0)