@@ -30,18 +30,24 @@ jobs:
3030 uses : actions/setup-dotnet@v4.0.0
3131 with :
3232 dotnet-version : 9.0.x
33- - name : Set nightly version
34- if : github.event_name == 'schedule' || inputs.nightly
33+ - name : Set version
3534 run : |
36- $gitVersion = git describe --tags --abbrev=0 2>$null
37- if ($gitVersion -match '^v?(\d+\.\d+\.\d+)') {
38- $baseVersion = $matches[1]
35+ if ("${{ github.event_name }}" -eq "schedule" -or "${{ inputs.nightly }}" -eq "true") {
36+ # Nightly build - override with specific format
37+ $gitVersion = git describe --tags --abbrev=0 2>$null
38+ if ($gitVersion -match '^v?(\d+\.\d+\.\d+)') {
39+ $baseVersion = $matches[1]
40+ } else {
41+ $baseVersion = "0.32.0"
42+ }
43+ $version = "$baseVersion-octopus-nightly-${{ github.run_number }}"
44+ Write-Host "Setting nightly version to: $version"
45+ "MINVERVERSIONOVERRIDE=$version" >> $env:GITHUB_ENV
3946 } else {
40- $baseVersion = "0.32.0"
47+ # Regular build - let MinVer calculate from tags/height, just ensure octopus is in default
48+ Write-Host "Using MinVer with default pre-release: octopus.${{ github.run_number }}"
49+ "MINVERDEFAULTPRERELEASEIDENTIFIERS=octopus.${{ github.run_number }}" >> $env:GITHUB_ENV
4150 }
42- $nightlyVersion = "$baseVersion-octopus-nightly-${{ github.run_number }}"
43- Write-Host "Setting nightly version to: $nightlyVersion"
44- "MINVERVERSIONOVERRIDE=$nightlyVersion" >> $env:GITHUB_ENV
4551 shell : pwsh
4652 - name : Build
4753 run : dotnet build LibGit2Sharp.sln --configuration Release
0 commit comments