diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 4ecdafa..15d965d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -67,7 +67,8 @@ jobs: - name: Generate version tag id: version run: | - TAG="v1.$(date -u +%y).${{ github.run_number }}.$(date -u +%m%d)" + BUILD_NUM=$(( ${{ github.run_number }} + 500 )) + TAG="v1.$(date -u +%y).${BUILD_NUM}.$(date -u +%m%d)" echo "tag=$TAG" >> "$GITHUB_OUTPUT" echo "Version: $TAG" diff --git a/JobTracker.csproj b/JobTracker.csproj index ad3ea45..8160576 100644 --- a/JobTracker.csproj +++ b/JobTracker.csproj @@ -5,13 +5,15 @@ enable enable true - - $(BUILD_NUMBER) - $([System.DateTime]::Now.ToString("HHmm")) + CI uses github.run_number; local builds fall back to HHmm. + BuildOffset ensures new versions (1.26.500+) are higher than old scheme (1.25.MMDD). --> + 500 + $([MSBuild]::Add($(BUILD_NUMBER), $(BuildOffset))) + $([MSBuild]::Add($([System.DateTime]::Now.ToString("HHmm")), $(BuildOffset))) 1.$([System.DateTime]::Now.ToString("yy")).$(BuildRevision).$([System.DateTime]::Now.ToString("MMdd")) $(DefaultItemExcludes);JobTracker.Tests\** wwwroot\favicon.ico