File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -33,17 +33,12 @@ jobs:
3333 - name : Build
3434 run : |
3535 if ("${{ github.event_name }}" -eq "pull_request" -and "${{ github.head_ref }}" -ne "") {
36- $gitDescribe = git describe --tags --abbrev=0 2>$null
37- # Extract the base version number if it exists, if not don't override
38- if ($gitDescribe -match '^v?(\d+\.\d+\.\d+)') {
39- $baseVersion = $matches[1]
40-
41- $branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
42- $version = "$baseVersion-octopus-$branchName.${{ github.run_number }}"
43-
44- Write-Host "PR build - overriding version to: $version"
45- $env:MINVERVERSIONOVERRIDE = $version
46- }
36+ $branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
37+ $preReleaseId = "$branchName.${{ github.run_number }}"
38+
39+ Write-Host "PR build - setting pre-release identifiers to: $preReleaseId (height ignored)"
40+ $env:IS_BRANCH_BUILD = "true"
41+ $env:BRANCH_PRE_RELEASE_ID = $preReleaseId
4742 }
4843
4944 dotnet build LibGit2Sharp.sln --configuration Release
Original file line number Diff line number Diff line change 2929 <IsTrimmable >true</IsTrimmable >
3030 </PropertyGroup >
3131
32+ <PropertyGroup Condition =" '$(IS_BRANCH_BUILD)' == 'true'" >
33+ <MinVerDefaultPreReleaseIdentifiers >octopus-$(BRANCH_PRE_RELEASE_ID)</MinVerDefaultPreReleaseIdentifiers >
34+ <MinVerIgnoreHeight >true</MinVerIgnoreHeight >
35+ </PropertyGroup >
36+
3237 <ItemGroup >
3338 <PackageReference Include =" LibGit2Sharp.NativeBinaries" Version =" [2.0.323]" PrivateAssets =" none" />
3439 <PackageReference Include =" MinVer" Version =" 6.0.0" PrivateAssets =" all" />
You can’t perform that action at this time.
0 commit comments