Merge pull request #11 from open-cli-collective/feature/complete-cicd… #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Winget Manifests | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'tools/*/packaging/winget/**' | |
| pull_request: | |
| paths: | |
| - 'tools/*/packaging/winget/**' | |
| jobs: | |
| test-cfl: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate manifest schema | |
| shell: pwsh | |
| run: | | |
| $testDir = "winget-validate-test" | |
| $testVersion = "0.0.1" | |
| $testHash1 = "0000000000000000000000000000000000000000000000000000000000000001" | |
| $testHash2 = "0000000000000000000000000000000000000000000000000000000000000002" | |
| New-Item -ItemType Directory -Path $testDir -Force | Out-Null | |
| # Version manifest | |
| $content = Get-Content "tools/cfl/packaging/winget/OpenCLICollective.cfl.yaml" -Raw | |
| $content = $content -replace "0\.0\.0", $testVersion | |
| Set-Content "$testDir/OpenCLICollective.cfl.yaml" $content -Encoding UTF8 | |
| # Locale manifest | |
| $content = Get-Content "tools/cfl/packaging/winget/OpenCLICollective.cfl.locale.en-US.yaml" -Raw | |
| $content = $content -replace "0\.0\.0", $testVersion | |
| Set-Content "$testDir/OpenCLICollective.cfl.locale.en-US.yaml" $content -Encoding UTF8 | |
| # Installer manifest | |
| $content = Get-Content "tools/cfl/packaging/winget/OpenCLICollective.cfl.installer.yaml" -Raw | |
| $content = $content -replace "0\.0\.0", $testVersion | |
| $regex = [regex]"0{64}" | |
| $content = $regex.Replace($content, $testHash1, 1) | |
| $content = $regex.Replace($content, $testHash2, 1) | |
| Set-Content "$testDir/OpenCLICollective.cfl.installer.yaml" $content -Encoding UTF8 | |
| Write-Host "Validating cfl winget manifest..." | |
| winget validate --manifest $testDir/ | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Error "Manifest validation failed" | |
| exit 1 | |
| } | |
| Write-Host "Manifest validation passed!" | |
| test-jtk: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate manifest schema | |
| shell: pwsh | |
| run: | | |
| $testDir = "winget-validate-test" | |
| $testVersion = "0.0.1" | |
| $testHash1 = "0000000000000000000000000000000000000000000000000000000000000001" | |
| $testHash2 = "0000000000000000000000000000000000000000000000000000000000000002" | |
| New-Item -ItemType Directory -Path $testDir -Force | Out-Null | |
| # Version manifest | |
| $content = Get-Content "tools/jtk/packaging/winget/OpenCLICollective.jira-ticket-cli.yaml" -Raw | |
| $content = $content -replace "0\.0\.0", $testVersion | |
| Set-Content "$testDir/OpenCLICollective.jira-ticket-cli.yaml" $content -Encoding UTF8 | |
| # Locale manifest | |
| $content = Get-Content "tools/jtk/packaging/winget/OpenCLICollective.jira-ticket-cli.locale.en-US.yaml" -Raw | |
| $content = $content -replace "0\.0\.0", $testVersion | |
| Set-Content "$testDir/OpenCLICollective.jira-ticket-cli.locale.en-US.yaml" $content -Encoding UTF8 | |
| # Installer manifest | |
| $content = Get-Content "tools/jtk/packaging/winget/OpenCLICollective.jira-ticket-cli.installer.yaml" -Raw | |
| $content = $content -replace "0\.0\.0", $testVersion | |
| $regex = [regex]"0{64}" | |
| $content = $regex.Replace($content, $testHash1, 1) | |
| $content = $regex.Replace($content, $testHash2, 1) | |
| Set-Content "$testDir/OpenCLICollective.jira-ticket-cli.installer.yaml" $content -Encoding UTF8 | |
| Write-Host "Validating jtk winget manifest..." | |
| winget validate --manifest $testDir/ | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Error "Manifest validation failed" | |
| exit 1 | |
| } | |
| Write-Host "Manifest validation passed!" |