Skip to content

Commit 8fe045d

Browse files
authored
LT-22298: Fix Patch Build Numbers (#491)
* 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
1 parent a2bbe92 commit 8fe045d

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

.github/workflows/base-installer-cd.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ jobs:
4646
- name: Compute build number
4747
id: build_number
4848
run: |
49-
$lastJenkins = 1097 # The last base build from jenkins
49+
$lastJenkins = 1100 # The last base build from jenkins, rounded to the next hundred
5050
$githubRun = $env:GITHUB_RUN_NUMBER
5151
$combined = $lastJenkins + $githubRun
5252
echo "Calculated build number: $combined"
53-
echo "RELEASE_BASE_BUILD_NUMBER=$combined" >> $env:GITHUB_ENV
53+
echo "RELEASE_BUILD_NUMBER=$combined" >> $env:GITHUB_ENV
5454
5555
- name: Checkout Files
5656
uses: actions/checkout@v4
@@ -237,7 +237,7 @@ jobs:
237237
$offlineFile = Split-Path $offlineExe -Leaf
238238
$onlineFile = Split-Path $onlineExe -Leaf
239239
240-
$s3BasePath = "jobs/FieldWorks-Win-all-Release-Base/$($env:RELEASE_BASE_BUILD_NUMBER)"
240+
$s3BasePath = "jobs/FieldWorks-Win-all-Release-Base/$($env:RELEASE_BUILD_NUMBER)"
241241
$offlineS3Key = "$s3BasePath/$offlineFile"
242242
$onlineS3Key = "$s3BasePath/$onlineFile"
243243
@@ -272,8 +272,8 @@ jobs:
272272
if: ${{ inputs.make_release == 'true' }}
273273
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836
274274
with:
275-
tag_name: build-${{ env.RELEASE_BASE_BUILD_NUMBER }}
276-
name: "FieldWorks Base Build #${{ env.RELEASE_BASE_BUILD_NUMBER }}"
275+
tag_name: build-${{ env.RELEASE_BUILD_NUMBER }}
276+
name: "FieldWorks Base Build #${{ env.RELEASE_BUILD_NUMBER }}"
277277
draft: false
278278
prerelease: true
279279
fail_on_unmatched_files: true

.github/workflows/patch-installer-cd.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ jobs:
5656
- name: Compute build number for archival
5757
id: build_number
5858
run: |
59-
$lastJenkins = 1976 # The last patch build from jenkins
59+
$lastJenkins = 2000 # The last patch build from jenkins, rounded to the next hundred
6060
$githubRun = $env:GITHUB_RUN_NUMBER
6161
$combined = $lastJenkins + $githubRun
6262
echo "Calculated build number: $combined"
63-
echo "BuildVersionSegment=$combined" >> $env:GITHUB_ENV
63+
echo "RELEASE_BUILD_NUMBER=$combined" >> $env:GITHUB_ENV
6464
6565
- name: Checkout Files
6666
uses: actions/checkout@v4
@@ -253,7 +253,6 @@ jobs:
253253
env:
254254
BASE_RELEASE: ${{ inputs.base_release || 'build-1155' }}
255255
BASE_BUILD_NUMBER: ${{ inputs.base_build_number || '' }}
256-
BUILD_VERSION_SEGMENT: ${{ env.BuildVersionSegment }}
257256
run: |
258257
# The github action base-installer-cd will make releases with a tag build-[build number]
259258
# manually created releases with Jenkins artifacts need to use existing tags so we need
@@ -266,7 +265,7 @@ jobs:
266265
}
267266
$baseBuildNumber = "_b$($env:BASE_RELEASE -replace '^build-','')"
268267
} else {
269-
throw "Must have a base_build_number nor a valid base_release to support automatic updating"
268+
throw "Must have a base_build_number or a valid base_release to support automatic updating"
270269
}
271270
$patchPath = "${{ steps.find_patch.outputs.patch_file }}"
272271
if (-not (Test-Path $patchPath)) {
@@ -279,7 +278,7 @@ jobs:
279278
throw "Unexpected patch filename format: $patchFile"
280279
}
281280
$patchWithBaseInName = "$($Matches[1])${baseBuildNumber}$($Matches[2])"
282-
$s3Key = "jobs/FieldWorks-Win-all-Release-Patch/$($env:BUILD_VERSION_SEGMENT)/$patchWithBaseInName"
281+
$s3Key = "jobs/FieldWorks-Win-all-Release-Patch/$($env:RELEASE_BUILD_NUMBER)/$patchWithBaseInName"
283282
aws s3 cp $patchPath "s3://flex-updates/$s3Key"
284283
Write-Host "Uploaded to s3://flex-updates/$s3Key"
285284

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ _user.mak.lnx
6464
*.log
6565
*.vshost.exe*
6666
*.sdf
67+
*.tmp
6768
*.opensdf
6869
*.orig
6970
.project

Build/Src/FwBuildTasks/Substitute.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ public override bool Execute()
7777
var numberOfDays = Convert.ToInt32(Math.Truncate(DateTime.Now.ToOADate())).ToString();
7878
fileContents = regex.Replace(fileContents, numberOfDays);
7979

80-
// GHA builds set the RELEASE_BASE_BUILD_NUMBER in the environment
81-
var buildNumber = Environment.GetEnvironmentVariable("RELEASE_BASE_BUILD_NUMBER");
80+
// GHA builds set the RELEASE_BUILD_NUMBER in the environment
81+
var buildNumber = Environment.GetEnvironmentVariable("RELEASE_BUILD_NUMBER");
8282
if (string.IsNullOrEmpty(buildNumber))
8383
{
84-
// fall back to number of days if no RELEASE_BASE_BUILD_NUMBER is in the environment
84+
// fall back to number of days if no RELEASE_BUILD_NUMBER is in the environment
8585
buildNumber = numberOfDays;
8686
}
8787
regex = new Regex("\\$BUILDNUMBER");

0 commit comments

Comments
 (0)