Skip to content

Commit 1c1181d

Browse files
Add PowerShell dependency to winget manifests
2 parents e0ec58f + d162399 commit 1c1181d

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

.github/workflows/winget.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,24 @@ jobs:
4141
.\wingetcreate.exe update $packageId `
4242
--version $packageVersion `
4343
--urls "$installerUrlx64|x64" "$installerUrlarm64|arm64" `
44-
--submit
44+
--out manifests
45+
46+
# Add PowerShell dependency to installer manifest
47+
$installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1 -ExpandProperty FullName
48+
if (-not $installerManifest) {
49+
Write-Error "No installer manifest (*.installer.yaml) was found in the 'manifests' directory."
50+
exit 1
51+
}
52+
$content = Get-Content -Path $installerManifest -Raw
53+
$dependency = @"
54+
Dependencies:
55+
PackageDependencies:
56+
- PackageIdentifier: Microsoft.PowerShell
57+
MinimumVersion: "7.0.0"
58+
"@
59+
# Insert dependency block before the Installers section
60+
$content = $content -replace '(?m)^Installers:', "$dependency`nInstallers:"
61+
Set-Content -Path $installerManifest -Value $content
62+
63+
# Submit the modified manifest
64+
.\wingetcreate.exe submit manifests

0 commit comments

Comments
 (0)