Skip to content

Commit c9ea9d2

Browse files
committed
more
1 parent d7ab367 commit c9ea9d2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ jobs:
3333
- name: Set version override
3434
if: github.event_name == 'pull_request' && github.head_ref != ''
3535
run: |
36-
$branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
37-
$preRelease = "octopus-$branchName.${{ github.run_number }}"
38-
Write-Host "PR build - using version override: $preRelease (height ignored)"
39-
"MINVERDEFAULTPRERELEASEIDENTIFIERS=$preRelease" >> $env:GITHUB_ENV
40-
"MINVERIGNOREHEIGHT=true" >> $env:GITHUB_ENV
36+
$gitDescribe = git describe --tags --abbrev=0 2>$null
37+
if ($gitDescribe -match '^v?(\d+\.\d+\.\d+)') {
38+
$baseVersion = $matches[1]
39+
40+
$branchName = "${{ github.head_ref }}" -replace '[/\\]', '-' -replace '[^a-zA-Z0-9\-]', ''
41+
$version = "$baseVersion-octopus-$branchName.${{ github.run_number }}"
42+
43+
"MINVERVERSIONOVERRIDE=$version" >> $env:GITHUB_ENV
44+
}
4145
shell: pwsh
4246
- name: Build
4347
run: dotnet build LibGit2Sharp.sln --configuration Release

0 commit comments

Comments
 (0)