@@ -20,54 +20,38 @@ jobs:
2020 - name : Validate manifest schema
2121 shell : pwsh
2222 run : |
23- # Create temp manifests with valid HTTPS URLs for schema validation
24- # (winget validate requires HTTPS URLs)
2523 $testDir = "winget-validate-test"
24+ $testVersion = "0.0.1"
25+ $testHash1 = "0000000000000000000000000000000000000000000000000000000000000001"
26+ $testHash2 = "0000000000000000000000000000000000000000000000000000000000000002"
27+
2628 New-Item -ItemType Directory -Path $testDir -Force | Out-Null
2729
28- Set-Content "$testDir/OpenCLICollective.cfl.yaml" -Encoding UTF8 @(
29- 'PackageIdentifier: OpenCLICollective.cfl'
30- 'PackageVersion: 0.0.1'
31- 'DefaultLocale: en-US'
32- 'ManifestType: version'
33- 'ManifestVersion: 1.6.0'
34- )
30+ # Read actual templates and substitute placeholders for validation
31+ Write-Host "Reading and processing actual template files..."
32+
33+ # Version manifest
34+ $content = Get-Content "packaging/winget/OpenCLICollective.cfl.yaml" -Raw
35+ $content = $content -replace "0\.0\.0", $testVersion
36+ Set-Content "$testDir/OpenCLICollective.cfl.yaml" $content -Encoding UTF8
37+
38+ # Locale manifest
39+ $content = Get-Content "packaging/winget/OpenCLICollective.cfl.locale.en-US.yaml" -Raw
40+ $content = $content -replace "0\.0\.0", $testVersion
41+ Set-Content "$testDir/OpenCLICollective.cfl.locale.en-US.yaml" $content -Encoding UTF8
3542
36- Set-Content "$testDir/OpenCLICollective.cfl.locale.en-US.yaml" -Encoding UTF8 @(
37- 'PackageIdentifier: OpenCLICollective.cfl'
38- 'PackageVersion: 0.0.1'
39- 'PackageLocale: en-US'
40- 'Publisher: Open CLI Collective'
41- 'PublisherUrl: https://github.com/open-cli-collective'
42- 'PackageName: Confluence CLI'
43- 'PackageUrl: https://github.com/open-cli-collective/confluence-cli'
44- 'License: MIT'
45- 'LicenseUrl: https://github.com/open-cli-collective/confluence-cli/blob/main/LICENSE'
46- 'ShortDescription: Command-line interface for Atlassian Confluence Cloud'
47- 'ManifestType: defaultLocale'
48- 'ManifestVersion: 1.6.0'
49- )
43+ # Installer manifest (substitute version and checksums)
44+ $content = Get-Content "packaging/winget/OpenCLICollective.cfl.installer.yaml" -Raw
45+ $content = $content -replace "0\.0\.0", $testVersion
46+ $regex = [regex]"0{64}"
47+ $content = $regex.Replace($content, $testHash1, 1)
48+ $content = $regex.Replace($content, $testHash2, 1)
49+ Set-Content "$testDir/OpenCLICollective.cfl.installer.yaml" $content -Encoding UTF8
5050
51- Set-Content "$testDir/OpenCLICollective.cfl.installer.yaml" -Encoding UTF8 @(
52- 'PackageIdentifier: OpenCLICollective.cfl'
53- 'PackageVersion: 0.0.1'
54- 'InstallerType: zip'
55- 'NestedInstallerType: portable'
56- 'NestedInstallerFiles:'
57- ' - RelativeFilePath: cfl.exe'
58- ' PortableCommandAlias: cfl'
59- 'Installers:'
60- ' - Architecture: x64'
61- ' InstallerUrl: https://github.com/open-cli-collective/confluence-cli/releases/download/v0.0.1/cfl_0.0.1_windows_amd64.zip'
62- ' InstallerSha256: 0000000000000000000000000000000000000000000000000000000000000001'
63- ' - Architecture: arm64'
64- ' InstallerUrl: https://github.com/open-cli-collective/confluence-cli/releases/download/v0.0.1/cfl_0.0.1_windows_arm64.zip'
65- ' InstallerSha256: 0000000000000000000000000000000000000000000000000000000000000002'
66- 'ManifestType: installer'
67- 'ManifestVersion: 1.6.0'
68- )
51+ Write-Host "Generated test manifests:"
52+ Get-ChildItem $testDir | ForEach-Object { Write-Host " $_" }
6953
70- Write-Host "Validating winget manifest schema..."
54+ Write-Host "`nValidating winget manifest schema..."
7155 winget validate --manifest $testDir/
7256 if ($LASTEXITCODE -ne 0) {
7357 Write-Error "Manifest schema validation failed"
0 commit comments