Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 92bb6f0

Browse files
authored
Merge pull request #89 from open-cli-collective/feat/winget-validation-improvements
feat: improve Winget manifest validation
2 parents 66d536b + 0167c70 commit 92bb6f0

7 files changed

Lines changed: 52 additions & 52 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,13 @@ jobs:
139139
Write-Host "Generated manifests:"
140140
Get-ChildItem $manifestDir | ForEach-Object { Write-Host " $_" }
141141
142+
Write-Host "`nValidating manifests..."
143+
winget validate --manifest $manifestDir
144+
if ($LASTEXITCODE -ne 0) {
145+
Write-Error "Manifest validation failed"
146+
exit 1
147+
}
148+
Write-Host "Validation passed!"
149+
142150
Write-Host "`nSubmitting new package to Winget..."
143151
./wingetcreate.exe submit --token ${{ secrets.WINGET_GITHUB_TOKEN }} $manifestDir

.github/workflows/test-winget.yml

Lines changed: 26 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -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"

.github/workflows/winget-publish.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,13 @@ jobs:
103103
Write-Host "Generated manifests:"
104104
Get-ChildItem $manifestDir | ForEach-Object { Write-Host " $_" }
105105
106+
Write-Host "`nValidating manifests..."
107+
winget validate --manifest $manifestDir
108+
if ($LASTEXITCODE -ne 0) {
109+
Write-Error "Manifest validation failed"
110+
exit 1
111+
}
112+
Write-Host "Validation passed!"
113+
106114
Write-Host "`nSubmitting new package to Winget..."
107115
./wingetcreate.exe submit --token ${{ secrets.WINGET_GITHUB_TOKEN }} $manifestDir

packaging/winget/OpenCLICollective.cfl.installer.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.6.0.schema.json
1+
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.10.0.schema.json
22

33
PackageIdentifier: OpenCLICollective.cfl
44
PackageVersion: 0.0.0
@@ -15,4 +15,4 @@ Installers:
1515
InstallerUrl: https://github.com/open-cli-collective/confluence-cli/releases/download/v0.0.0/cfl_0.0.0_windows_arm64.zip
1616
InstallerSha256: 0000000000000000000000000000000000000000000000000000000000000000
1717
ManifestType: installer
18-
ManifestVersion: 1.6.0
18+
ManifestVersion: 1.10.0

packaging/winget/OpenCLICollective.cfl.locale.en-US.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.6.0.schema.json
1+
# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.10.0.schema.json
22

33
PackageIdentifier: OpenCLICollective.cfl
44
PackageVersion: 0.0.0
@@ -24,4 +24,4 @@ Tags:
2424
- documentation
2525
ReleaseNotesUrl: https://github.com/open-cli-collective/confluence-cli/releases
2626
ManifestType: defaultLocale
27-
ManifestVersion: 1.6.0
27+
ManifestVersion: 1.10.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.6.0.schema.json
1+
# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.10.0.schema.json
22

33
PackageIdentifier: OpenCLICollective.cfl
44
PackageVersion: 0.0.0
55
DefaultLocale: en-US
66
ManifestType: version
7-
ManifestVersion: 1.6.0
7+
ManifestVersion: 1.10.0

packaging/winget/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ wingetcreate update OpenCLICollective.cfl --version <VERSION> --urls <x64_url> <
6969

7070
## Manifest Schema
7171

72-
These manifests use schema version 1.6.0:
73-
- [Version manifest schema](https://aka.ms/winget-manifest.version.1.6.0.schema.json)
74-
- [Installer manifest schema](https://aka.ms/winget-manifest.installer.1.6.0.schema.json)
75-
- [Locale manifest schema](https://aka.ms/winget-manifest.defaultLocale.1.6.0.schema.json)
72+
These manifests use schema version 1.10.0:
73+
- [Version manifest schema](https://aka.ms/winget-manifest.version.1.10.0.schema.json)
74+
- [Installer manifest schema](https://aka.ms/winget-manifest.installer.1.10.0.schema.json)
75+
- [Locale manifest schema](https://aka.ms/winget-manifest.defaultLocale.1.10.0.schema.json)
7676

7777
## Installer Type
7878

0 commit comments

Comments
 (0)