From 916fd0e9efbb2eb3cc5383f479a8068d8ae30880 Mon Sep 17 00:00:00 2001 From: Raymond Stone Date: Thu, 9 Apr 2026 15:25:47 +0100 Subject: [PATCH] Update versioning scheme to ensure monotonic build numbers Updated both the GitHub Actions workflow and JobTracker.csproj to add a build offset of 500 to the build number, ensuring new versions are always higher than previous ones, even after changing the versioning logic. Adjusted comments and logic to reflect the new scheme. --- .github/workflows/dotnet.yml | 3 ++- JobTracker.csproj | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) 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