This repository was archived by the owner on Feb 6, 2026. It is now read-only.
fix: simplify manifest generation in CI workflow #3
Workflow file for this run
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 Manifest | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'packaging/winget/**' | ||
| - '.github/workflows/test-winget.yml' | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'packaging/winget/**' | ||
| - '.github/workflows/test-winget.yml' | ||
| jobs: | ||
| test-winget: | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.22' | ||
| - name: Build binary for testing | ||
| run: go build -o cfl.exe ./cmd/cfl | ||
| - name: Create test zip package | ||
| shell: pwsh | ||
| run: | | ||
| # Create zip matching our release structure | ||
| Compress-Archive -Path cfl.exe, LICENSE, README.md -DestinationPath cfl_0.0.1_windows_amd64.zip | ||
| # Calculate SHA256 | ||
| $hash = (Get-FileHash cfl_0.0.1_windows_amd64.zip -Algorithm SHA256).Hash | ||
| Write-Host "SHA256: $hash" | ||
| # Update version manifest | ||
| $versionManifest = @" | ||
| PackageIdentifier: OpenCLICollective.cfl | ||
| PackageVersion: 0.0.1 | ||
| DefaultLocale: en-US | ||
| ManifestType: version | ||
| ManifestVersion: 1.6.0 | ||
| "@ | ||
| Set-Content packaging/winget/OpenCLICollective.cfl.yaml $versionManifest | ||
| # Update locale manifest | ||
| $localeManifest = @" | ||
| PackageIdentifier: OpenCLICollective.cfl | ||
| PackageVersion: 0.0.1 | ||
| PackageLocale: en-US | ||
| Publisher: Open CLI Collective | ||
| PublisherUrl: https://github.com/open-cli-collective | ||
| PackageName: Confluence CLI | ||
| PackageUrl: https://github.com/open-cli-collective/confluence-cli | ||
| License: MIT | ||
| LicenseUrl: https://github.com/open-cli-collective/confluence-cli/blob/main/LICENSE | ||
| ShortDescription: Command-line interface for Atlassian Confluence Cloud | ||
| ManifestType: defaultLocale | ||
| ManifestVersion: 1.6.0 | ||
| "@ | ||
| Set-Content packaging/winget/OpenCLICollective.cfl.locale.en-US.yaml $localeManifest | ||
| # Create installer manifest with local file URL | ||
| $localUrl = "file:///$($pwd.Path -replace '\\','/')/cfl_0.0.1_windows_amd64.zip" | ||
| $installerManifest = @" | ||
| PackageIdentifier: OpenCLICollective.cfl | ||
| PackageVersion: 0.0.1 | ||
| InstallerType: zip | ||
| NestedInstallerType: portable | ||
| NestedInstallerFiles: | ||
| - RelativeFilePath: cfl.exe | ||
| PortableCommandAlias: cfl | ||
| Installers: | ||
| - Architecture: x64 | ||
| InstallerUrl: $localUrl | ||
| InstallerSha256: $hash | ||
| ManifestType: installer | ||
| ManifestVersion: 1.6.0 | ||
| "@ | ||
| Set-Content packaging/winget/OpenCLICollective.cfl.installer.yaml $installerManifest | ||
| Write-Host "Updated manifests for testing:" | ||
| Get-Content packaging/winget/OpenCLICollective.cfl.installer.yaml | ||
| - name: Validate manifests | ||
| shell: pwsh | ||
| run: | | ||
| Write-Host "Validating Winget manifests..." | ||
| winget validate --manifest packaging/winget/ | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Error "Manifest validation failed" | ||
| exit 1 | ||
| } | ||
| Write-Host "Manifest validation passed!" | ||
| - name: Install from local manifest | ||
| shell: pwsh | ||
| run: | | ||
| Write-Host "Installing from local manifest..." | ||
| winget install --manifest packaging/winget/ --accept-package-agreements --accept-source-agreements | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Error "Installation failed" | ||
| exit 1 | ||
| } | ||
| - name: Verify installation | ||
| shell: pwsh | ||
| run: | | ||
| Write-Host "Testing cfl --version..." | ||
| cfl --version | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Error "cfl --version failed" | ||
| exit 1 | ||
| } | ||
| Write-Host "cfl is working!" | ||
| - name: Test uninstall | ||
| shell: pwsh | ||
| run: | | ||
| winget uninstall OpenCLICollective.cfl --accept-source-agreements | ||
| Write-Host "Uninstall completed" | ||