Skip to content

Commit 3df5b14

Browse files
Add S3 upload step to base-installer-cd.yml workflow
Co-authored-by: jasonleenaylor <2295227+jasonleenaylor@users.noreply.github.com>
1 parent 6806b33 commit 3df5b14

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,41 @@ jobs:
212212
description: 'FieldWorks Installer'
213213
description-url: 'https://software.sil.org/fieldworks/'
214214

215+
- name: Configure AWS credentials
216+
if: ${{ inputs.make_release == 'true' }}
217+
uses: aws-actions/configure-aws-credentials@v4
218+
with:
219+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
220+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
221+
aws-region: us-east-1
222+
223+
- name: Upload Installers to S3
224+
if: ${{ inputs.make_release == 'true' }}
225+
shell: pwsh
226+
run: |
227+
$offlineExe = "${{ steps.stage_installers.outputs.offline_exe }}"
228+
$onlineExe = "${{ steps.stage_installers.outputs.online_exe }}"
229+
230+
if (-not (Test-Path $offlineExe)) {
231+
throw "Offline installer not found at $offlineExe"
232+
}
233+
if (-not (Test-Path $onlineExe)) {
234+
throw "Online installer not found at $onlineExe"
235+
}
236+
237+
$offlineFile = Split-Path $offlineExe -Leaf
238+
$onlineFile = Split-Path $onlineExe -Leaf
239+
240+
$s3BasePath = "jobs/FieldWorks-Win-all-Release-Base/$($env:RELEASE_BASE_BUILD_NUMBER)"
241+
$offlineS3Key = "$s3BasePath/$offlineFile"
242+
$onlineS3Key = "$s3BasePath/$onlineFile"
243+
244+
aws s3 cp $offlineExe "s3://flex-updates/$offlineS3Key"
245+
Write-Host "Uploaded offline installer to s3://flex-updates/$offlineS3Key"
246+
247+
aws s3 cp $onlineExe "s3://flex-updates/$onlineS3Key"
248+
Write-Host "Uploaded online installer to s3://flex-updates/$onlineS3Key"
249+
215250
- name: Compress Build Artifacts
216251
if: ${{ inputs.make_release == 'true' }}
217252
run: |

0 commit comments

Comments
 (0)