File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed
Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -30,21 +30,23 @@ jobs:
3030 uses : actions/setup-dotnet@v4.0.0
3131 with :
3232 dotnet-version : 9.0.x
33- - name : Set version override
34- if : github.event_name == 'pull_request' && github.head_ref != ''
33+ - name : Build
3534 run : |
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- }
35+ if ("${{ github.event_name }}" -eq "pull_request" -and "${{ github.head_ref }}" -ne "") {
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+ Write-Host "PR build - overriding version to: $version"
44+ $env:MINVERVERSIONOVERRIDE = $version
45+ }
46+ }
47+
48+ dotnet build LibGit2Sharp.sln --configuration Release
4549 shell : pwsh
46- - name : Build
47- run : dotnet build LibGit2Sharp.sln --configuration Release
4850 - name : Show version
4951 run : |
5052 $package = Get-ChildItem artifacts/package/*.nupkg | Select-Object -First 1
You can’t perform that action at this time.
0 commit comments