From 79c6d905a27f5f201adc66c56f36ce5673750cbb Mon Sep 17 00:00:00 2001 From: Hasso Date: Fri, 17 Oct 2025 16:19:22 -0500 Subject: [PATCH] LT-22298: Fix Patch Build Numbers * Rename all former BUILD_NUMBER references to RELEASE_BUILD_NUMBER. * Round $lastJenkins build numbers to the next hundred for easier association with GHA run numbers. * Also ignore nunit_random_seed.tmp Change-Id: Ic040408ad62a9846558cb84700bad0b7591f8576 --- .github/workflows/base-installer-cd.yml | 10 +++++----- .github/workflows/patch-installer-cd.yml | 9 ++++----- .gitignore | 1 + Build/Src/FwBuildTasks/Substitute.cs | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/base-installer-cd.yml b/.github/workflows/base-installer-cd.yml index 912f169d1b..3428ac7678 100644 --- a/.github/workflows/base-installer-cd.yml +++ b/.github/workflows/base-installer-cd.yml @@ -46,11 +46,11 @@ jobs: - name: Compute build number id: build_number run: | - $lastJenkins = 1097 # The last base build from jenkins + $lastJenkins = 1100 # The last base build from jenkins, rounded to the next hundred $githubRun = $env:GITHUB_RUN_NUMBER $combined = $lastJenkins + $githubRun echo "Calculated build number: $combined" - echo "RELEASE_BASE_BUILD_NUMBER=$combined" >> $env:GITHUB_ENV + echo "RELEASE_BUILD_NUMBER=$combined" >> $env:GITHUB_ENV - name: Checkout Files uses: actions/checkout@v4 @@ -237,7 +237,7 @@ jobs: $offlineFile = Split-Path $offlineExe -Leaf $onlineFile = Split-Path $onlineExe -Leaf - $s3BasePath = "jobs/FieldWorks-Win-all-Release-Base/$($env:RELEASE_BASE_BUILD_NUMBER)" + $s3BasePath = "jobs/FieldWorks-Win-all-Release-Base/$($env:RELEASE_BUILD_NUMBER)" $offlineS3Key = "$s3BasePath/$offlineFile" $onlineS3Key = "$s3BasePath/$onlineFile" @@ -272,8 +272,8 @@ jobs: if: ${{ inputs.make_release == 'true' }} uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 with: - tag_name: build-${{ env.RELEASE_BASE_BUILD_NUMBER }} - name: "FieldWorks Base Build #${{ env.RELEASE_BASE_BUILD_NUMBER }}" + tag_name: build-${{ env.RELEASE_BUILD_NUMBER }} + name: "FieldWorks Base Build #${{ env.RELEASE_BUILD_NUMBER }}" draft: false prerelease: true fail_on_unmatched_files: true diff --git a/.github/workflows/patch-installer-cd.yml b/.github/workflows/patch-installer-cd.yml index 0da1dcb4a8..37aff02f78 100644 --- a/.github/workflows/patch-installer-cd.yml +++ b/.github/workflows/patch-installer-cd.yml @@ -56,11 +56,11 @@ jobs: - name: Compute build number for archival id: build_number run: | - $lastJenkins = 1976 # The last patch build from jenkins + $lastJenkins = 2000 # The last patch build from jenkins, rounded to the next hundred $githubRun = $env:GITHUB_RUN_NUMBER $combined = $lastJenkins + $githubRun echo "Calculated build number: $combined" - echo "BuildVersionSegment=$combined" >> $env:GITHUB_ENV + echo "RELEASE_BUILD_NUMBER=$combined" >> $env:GITHUB_ENV - name: Checkout Files uses: actions/checkout@v4 @@ -253,7 +253,6 @@ jobs: env: BASE_RELEASE: ${{ inputs.base_release || 'build-1155' }} BASE_BUILD_NUMBER: ${{ inputs.base_build_number || '' }} - BUILD_VERSION_SEGMENT: ${{ env.BuildVersionSegment }} run: | # The github action base-installer-cd will make releases with a tag build-[build number] # manually created releases with Jenkins artifacts need to use existing tags so we need @@ -266,7 +265,7 @@ jobs: } $baseBuildNumber = "_b$($env:BASE_RELEASE -replace '^build-','')" } else { - throw "Must have a base_build_number nor a valid base_release to support automatic updating" + throw "Must have a base_build_number or a valid base_release to support automatic updating" } $patchPath = "${{ steps.find_patch.outputs.patch_file }}" if (-not (Test-Path $patchPath)) { @@ -279,7 +278,7 @@ jobs: throw "Unexpected patch filename format: $patchFile" } $patchWithBaseInName = "$($Matches[1])${baseBuildNumber}$($Matches[2])" - $s3Key = "jobs/FieldWorks-Win-all-Release-Patch/$($env:BUILD_VERSION_SEGMENT)/$patchWithBaseInName" + $s3Key = "jobs/FieldWorks-Win-all-Release-Patch/$($env:RELEASE_BUILD_NUMBER)/$patchWithBaseInName" aws s3 cp $patchPath "s3://flex-updates/$s3Key" Write-Host "Uploaded to s3://flex-updates/$s3Key" diff --git a/.gitignore b/.gitignore index 4f0dee318c..654ec6bd86 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,7 @@ _user.mak.lnx *.log *.vshost.exe* *.sdf +*.tmp *.opensdf *.orig .project diff --git a/Build/Src/FwBuildTasks/Substitute.cs b/Build/Src/FwBuildTasks/Substitute.cs index a13517b32f..33c0c81f28 100644 --- a/Build/Src/FwBuildTasks/Substitute.cs +++ b/Build/Src/FwBuildTasks/Substitute.cs @@ -77,11 +77,11 @@ public override bool Execute() var numberOfDays = Convert.ToInt32(Math.Truncate(DateTime.Now.ToOADate())).ToString(); fileContents = regex.Replace(fileContents, numberOfDays); - // GHA builds set the RELEASE_BASE_BUILD_NUMBER in the environment - var buildNumber = Environment.GetEnvironmentVariable("RELEASE_BASE_BUILD_NUMBER"); + // GHA builds set the RELEASE_BUILD_NUMBER in the environment + var buildNumber = Environment.GetEnvironmentVariable("RELEASE_BUILD_NUMBER"); if (string.IsNullOrEmpty(buildNumber)) { - // fall back to number of days if no RELEASE_BASE_BUILD_NUMBER is in the environment + // fall back to number of days if no RELEASE_BUILD_NUMBER is in the environment buildNumber = numberOfDays; } regex = new Regex("\\$BUILDNUMBER");