Skip to content

Commit 54984ce

Browse files
committed
fix(CI): Install WinGet deps from GitHub
1 parent e49eb84 commit 54984ce

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,52 @@ jobs:
4343
# so we delete everything that could mess up our builds
4444
run: rmdir /S /Q C:\Strawberry
4545

46+
- name: Install Winget Dependencies (ARM64) from Zip
47+
if: contains(matrix.arch, 'arm64') # Assuming matrix.arch will be 'arm64' for this job
48+
run: |
49+
$tempDir = Join-Path $env:TEMP "WingetDependencies"
50+
$zipFilePath = Join-Path $env:TEMP "DesktopAppInstaller_Dependencies.zip"
51+
$arm64DepsDir = Join-Path $tempDir "arm64" # Path to the arm64 folder inside the unzipped content
52+
53+
# Create temporary directory if it doesn't exist
54+
New-Item -ItemType Directory -Force -Path $tempDir | Out-Null
55+
56+
Write-Host "Downloading DesktopAppInstaller_Dependencies.zip to $zipFilePath..."
57+
try {
58+
Invoke-WebRequest -Uri https://github.com/microsoft/winget-cli/releases/download/v1.10.390/DesktopAppInstaller_Dependencies.zip -OutFile $zipFilePath -TimeoutSec 300
59+
} catch {
60+
Write-Error "Failed to download DesktopAppInstaller_Dependencies.zip: $($_.Exception.Message)"
61+
exit 1
62+
}
63+
64+
Write-Host "Extracting dependencies to $tempDir..."
65+
try {
66+
Expand-Archive -Path $zipFilePath -DestinationPath $tempDir -Force
67+
} catch {
68+
Write-Error "Failed to extract zip file: $($_.Exception.Message)"
69+
exit 1
70+
}
71+
72+
# Install ARM64 dependencies
73+
Write-Host "Installing ARM64 dependencies from $arm64DepsDir..."
74+
try {
75+
# Get all .appx files in the arm64 directory
76+
$arm64AppxFiles = Get-ChildItem -Path $arm64DepsDir -Filter "*.appx" -Recurse | Select-Object -ExpandProperty FullName
77+
78+
if ($arm64AppxFiles.Count -eq 0) {
79+
Write-Warning "No ARM64 .appx files found in $arm64DepsDir. This might indicate an issue with the downloaded package or path."
80+
} else {
81+
foreach ($appxFile in $arm64AppxFiles) {
82+
Write-Host "Installing $appxFile..."
83+
Add-AppxPackage -Path $appxFile
84+
}
85+
}
86+
} catch {
87+
Write-Error "Failed to install ARM64 AppX packages: $($_.Exception.Message)"
88+
exit 1
89+
}
90+
shell: pwsh
91+
4692
- name: Install Winget (ARM64)
4793
if: contains(matrix.arch, 'arm64')
4894
run: |

0 commit comments

Comments
 (0)