Skip to content

Commit

Permalink
Merge 28005b1 into b226c75
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnmoreels authored May 30, 2022
2 parents b226c75 + 28005b1 commit 399716c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
18 changes: 18 additions & 0 deletions determine-pr-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ parameters:
values:
- none
- alpha
packageType:
type: string
default: NuGet
values:
- NuGet
- Python

steps:
- bash: |
Expand Down Expand Up @@ -65,6 +71,18 @@ steps:
Write-Host "Overriding package version given it's a master build"
$packageVersion = '$(Build.BuildNumber)';
$packageVersion = "alpha$packageVersion"
} elseif ('${{ parameters.packageType }}' -eq 'NuGet') {
Write-Host "Using released NuGet version in IndividualCI build"
$nugetSearchUrl = "https://azuresearch-usnc.nuget.org/query?q=$(Project)&prerelease=false"
$response = Invoke-WebRequest $nugetSearchUrl
$json = ConvertFrom-Json $response.Content
$currentVersion = $json.data[0].version
if ($currentVersion -eq $null) {
$currentVersion = "0.1.0"
}
$patch = "$(Build.BuildNumber)"
$packageVersion = "$currentVersion-preview-$patch"
} else {
$packageVersion = "$packageVersion-${{ parameters.manualTriggerVersion }}"
}
Expand Down
3 changes: 2 additions & 1 deletion nuget/determine-pr-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ steps:
manualTriggerVersion: ${{ parameters.manualTriggerVersion }}
packageVersionVariableName: ${{ parameters.packageVersionVariableName }}
pullRequestFormat: PR
invidualCIFormat: none
invidualCIFormat: none
packageType: 'NuGet'
1 change: 1 addition & 0 deletions pypi/determine-pr-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ steps:
packageVersionVariableName: ${{ parameters.packageVersionVariableName }}
pullRequestFormat: dev
invidualCIFormat: alpha
packageType: 'Python'

0 comments on commit 399716c

Please sign in to comment.