2424 description : ' Commit-ish for liblcm repository'
2525 required : false
2626 default : ' master'
27+ # default should be changed to the most recent base release for the release cycle
2728 base_release :
2829 description : ' The github release for the base build artifacts'
2930 default : ' FieldWorks9.3.0'
31+ base_build_number :
32+ description : ' The base build number (only for bootstrapping, should be removed after 9.3 is the stable)'
33+ required : false
34+ default : ' '
3035 make_release :
31- description : ' Should the build archive a release, false by default, should be set to true on a release build. '
36+ description : ' Should the release be pushed to s3 - use false for test builds '
3237 required : false
3338 default : ' true'
3439
5459 $lastJenkins = 1976 # The last patch build from jenkins
5560 $githubRun = $env:GITHUB_RUN_NUMBER
5661 $combined = $lastJenkins + $githubRun
57- echo "Last Jenkins build: $lastJenkins"
58- echo "GitHub run number: $githubRun"
59- echo "Combined build number: $combined"
60- echo "RELEASE_BASE_BUILD_NUMBER=$combined" >> $env:GITHUB_ENV
62+ echo "Calculated build number: $combined"
63+ echo "BuildVersionSegment=$combined" >> $env:GITHUB_ENV
6164
6265 - name : Checkout Files
6366 uses : actions/checkout@v4
@@ -213,6 +216,7 @@ jobs:
213216 Write-Host "No errors found" -ForegroundColor green
214217 exit 0
215218 }
219+
216220 - name : Find patch installer
217221 id : find_patch
218222 shell : pwsh
@@ -233,6 +237,57 @@ jobs:
233237 description : ' FieldWorks Patch Installer'
234238 description-url : ' https://software.sil.org/fieldworks/'
235239
240+ - name : Configure AWS credentials
241+ if : ${{ inputs.make_release == 'true' }}
242+ uses : aws-actions/configure-aws-credentials@v4
243+ with :
244+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
245+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
246+ aws-region : us-east-1
247+
248+ - name : Upload Patch to S3
249+ if : ${{ inputs.make_release == 'true' }}
250+ shell : pwsh
251+ env :
252+ BASE_RELEASE : ${{ inputs.base_release }}
253+ BASE_BUILD_NUMBER : ${{ inputs.base_build_number }}
254+ BUILD_VERSION_SEGMENT : ${{ env.BuildVersionSegment }}
255+ run : |
256+ # --- Decide baseBuildNumber (_b###) ---
257+ if ($env:BASE_BUILD_NUMBER -and $env:BASE_BUILD_NUMBER.Trim() -ne "") {
258+ $baseBuildNumber = "_b$($env:BASE_BUILD_NUMBER)"
259+ } elseif ($env:BASE_RELEASE -and $env:BASE_RELEASE.Trim() -ne "") {
260+ if ($env:BASE_RELEASE -notmatch '^build-\d+$') {
261+ throw "BASE_RELEASE must start with 'build-' (got '$env:BASE_RELEASE')"
262+ }
263+ $baseBuildNumber = "_b$($env:BASE_RELEASE -replace '^build-','')"
264+ } else {
265+ throw "Must have a base_build_number nor a valid base_release to support automatic updating"
266+ }
267+
268+ # --- Locate patch file ---
269+ $patchPath = "${{ steps.find_patch.outputs.patch_file }}"
270+ if (-not (Test-Path $patchPath)) {
271+ throw "Patch file not found at $patchPath"
272+ }
273+
274+ $patchFile = Split-Path $patchPath -Leaf
275+ $patchDir = Split-Path $patchPath -Parent
276+
277+ # --- Insert baseBuildNumber before _x64.msp necessary for Automatic Update code Src\Common\FwUtils\FwUpdater.cs---
278+ if ($patchFile -notmatch '^(.*)(_x64\.msp)$') {
279+ throw "Unexpected patch filename format: $patchFile"
280+ }
281+ $patchWithBaseInName = "$($Matches[1])${baseBuildNumber}$($Matches[2])"
282+
283+ Write-Host "Renaming $patchFile -> $patchWithBaseInName"
284+
285+ # --- Upload to S3 ---
286+ $s3Key = "flex-updates/jobs/FieldWorks-Win-all-Release-Patch/$($env:BUILD_VERSION_SEGMENT)/$patchWithBaseInName"
287+ aws s3 cp $patchPath "s3://flex-updates/$s3Key"
288+
289+ Write-Host "Uploaded to s3://flex-updates/$s3Key"
290+
236291 - name : Upload Build Logs
237292 uses : actions/upload-artifact@v4
238293 if : always()
0 commit comments