Skip to content

Commit

Permalink
Test new name
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Li <[email protected]>
  • Loading branch information
KevinLiAWS committed Oct 13, 2023
1 parent bd2f704 commit ddca4b1
Showing 1 changed file with 9 additions and 37 deletions.
46 changes: 9 additions & 37 deletions .github/workflows/build-and-test-pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ jobs:
- name: generate and download signed msi
run: |
$version="${{ needs.get-tag-name.outputs.version }}"
$tag="${{ needs.get-tag-name.outputs.tag }}"
powershell .\msi-builder\BuildFinchMSI.ps1 -Version $version
$timestamp=[math]::truncate((Get-Date (Get-Date).ToUniversalTime() -UFormat "%s"))
$unsignedMSI="Finch-$version-$timestamp.msi"
$unsignedMSI="Finch-$tag-$timestamp.msi"
Write-Host "Upload unsigned MSI: $unsignedMSI"
aws s3 cp "./msi-builder/build/Finch-$version.msi" "${{ secrets.WINDOWS_UNSIGNED_BUCKET }}$unsignedMSI" --acl bucket-owner-full-control --no-progress
Expand All @@ -110,7 +110,7 @@ jobs:
$signedMSI = aws s3 ls ${{ secrets.WINDOWS_SIGNED_BUCKET }} 2>&1 | Where-Object { $_ -match "$unsignedMSI" } | Sort-Object -Descending | Select-Object -First 1 | ForEach-Object { ($_ -split '\s+')[-1] }
if ($signedMSI -and ($signedMSI -notlike "*An error occurred (404) when calling the HeadObject operation*")) {
try {
aws s3 cp "${{ secrets.WINDOWS_SIGNED_BUCKET }}$signedMSI" "./msi-builder/build/signed/Finch-$version.msi"
aws s3 cp "${{ secrets.WINDOWS_SIGNED_BUCKET }}$signedMSI" "./msi-builder/build/signed/Finch-$tag.msi"
break
} catch {
Write-Host "Error during copy: $_"
Expand All @@ -132,21 +132,8 @@ jobs:
aws-region: ${{ secrets.REGION }}
- name: upload signed MSI to S3
run: |
$version="${{ needs.get-tag-name.outputs.version }}"
aws s3 cp "./msi-builder/build/signed/Finch-$version.msi" "s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-$version.msi" --no-progress
- name: Remove Finch VM and Clean Up Previous Environment
if: ${{ always() }}
run: |
# We want these cleanup commands to always run, ignore errors so the step completes.
$ErrorActionPreference = 'Ignore'
wsl --list --verbose
wsl --shutdown
wsl --unregister lima-finch
wsl --list --verbose
Remove-Item C:\Users\Administrator\AppData\Local\.finch -Recurse
make clean
cd deps/finch-core && make clean
exit 0 # Cleanup may set the exit code e.g. if a file doesn't exist; just ignore
$tag="${{ needs.get-tag-name.outputs.tag }}"
aws s3 cp "./msi-builder/build/signed/Finch-$tag.msi" "s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-$tag.msi" --no-progress
msi-e2e-tests:
needs:
Expand Down Expand Up @@ -197,8 +184,6 @@ jobs:
run: |
Remove-Item C:\Users\Administrator\.finch -Recurse -ErrorAction Ignore
Remove-Item C:\Users\Administrator\AppData\Local\.finch -Recurse -ErrorAction Ignore
make clean
cd deps/finch-core && make clean
- name: Uninstall Finch silently
run: |
$productCode = (Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "*Finch*" } | Select-Object -ExpandProperty IdentifyingNumber)
Expand All @@ -209,8 +194,8 @@ jobs:
}
- name: Download MSI from S3
run: |
$version="${{ needs.get-tag-name.outputs.version }}"
aws s3 cp "s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-$version.msi" ./Finch.msi
$tag="${{ needs.get-tag-name.outputs.tag }}"
aws s3 cp "s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-$tag.msi" ./Finch.msi
- name: Install MSI silently
run: |
Start-Process 'Finch.msi' -ArgumentList '/quiet' -Wait
Expand All @@ -228,24 +213,11 @@ jobs:
$env:INSTALLED="true"
make test-e2e
- name: Uninstall Finch silently
if: ${{ always() }}
if: always()
run: |
$productCode = (Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "*Finch*" } | Select-Object -ExpandProperty IdentifyingNumber)
if ($productCode) {
msiexec /x $productCode /qn
} else {
Write-Output "Finch not found or it wasn't installed using MSI."
}
- name: Remove Finch VM and Clean Up Previous Environment
if: ${{ always() }}
run: |
# We want these cleanup commands to always run, ignore errors so the step completes.
$ErrorActionPreference = 'Ignore'
wsl --list --verbose
wsl --shutdown
wsl --unregister lima-finch
wsl --list --verbose
Remove-Item C:\Users\Administrator\AppData\Local\.finch -Recurse
make clean
cd deps/finch-core && make clean
exit 0 # Cleanup may set the exit code e.g. if a file doesn't exist; just ignore
}

0 comments on commit ddca4b1

Please sign in to comment.