From 75aea71059003894311b5015965fd3e8e6f96abe Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Sat, 7 Feb 2026 08:23:47 -0500 Subject: [PATCH 1/2] fix: use template-based winget submit instead of wingetcreate update wingetcreate update fetches the published manifest from microsoft/winget-pkgs, which still has RelativeFilePath: jira-ticket-cli.exe from before the rename. The zip now contains jtk.exe, causing "Nested installer not found" errors. Switch to a template-based approach: copy local manifest templates, substitute version/checksum placeholders, and use wingetcreate submit. This bypasses the auto-detection entirely and gives full control over manifest content. Also updates installer template to use distinct checksum placeholders (CHECKSUM_AMD64_PLACEHOLDER, CHECKSUM_ARM64_PLACEHOLDER) to avoid PowerShell -replace ordering ambiguity, and updates README with correct binary names and URL patterns. --- .github/workflows/release-jtk.yml | 32 ++++++++----- ...ICollective.jira-ticket-cli.installer.yaml | 4 +- tools/jtk/packaging/winget/README.md | 48 +++++++++---------- 3 files changed, 45 insertions(+), 39 deletions(-) diff --git a/.github/workflows/release-jtk.yml b/.github/workflows/release-jtk.yml index 2d132cd3..73c6541f 100644 --- a/.github/workflows/release-jtk.yml +++ b/.github/workflows/release-jtk.yml @@ -117,26 +117,34 @@ jobs: $tag = "jtk-v$version" gh release download $tag --pattern "checksums.txt" --dir artifacts - - name: Extract checksums + - name: Prepare winget manifests run: | $version = "${{ needs.goreleaser.outputs.version }}" $checksums = Get-Content artifacts/checksums.txt $amd64 = ($checksums | Select-String "jtk_${version}_windows_amd64.zip").ToString().Split(" ")[0] $arm64 = ($checksums | Select-String "jtk_${version}_windows_arm64.zip").ToString().Split(" ")[0] - echo "CHECKSUM_AMD64=$amd64" >> $env:GITHUB_ENV - echo "CHECKSUM_ARM64=$arm64" >> $env:GITHUB_ENV + + # Copy templates to working directory + New-Item -ItemType Directory -Path manifests -Force + Copy-Item tools/jtk/packaging/winget/*.yaml manifests/ + + # Replace version placeholder in all manifest files + Get-ChildItem manifests/*.yaml | ForEach-Object { + $content = Get-Content $_.FullName -Raw + $content = $content -replace '0\.0\.0', $version + Set-Content $_.FullName $content -NoNewline + } + + # Set checksums in installer manifest (uses distinct placeholders) + $installer = Get-Content manifests/OpenCLICollective.jira-ticket-cli.installer.yaml -Raw + $installer = $installer -replace 'CHECKSUM_AMD64_PLACEHOLDER', $amd64 + $installer = $installer -replace 'CHECKSUM_ARM64_PLACEHOLDER', $arm64 + Set-Content manifests/OpenCLICollective.jira-ticket-cli.installer.yaml $installer -NoNewline - name: Install wingetcreate run: | iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe - - name: Update and submit manifest + - name: Submit manifests run: | - $version = "${{ needs.goreleaser.outputs.version }}" - $baseUrl = "https://github.com/open-cli-collective/atlassian-cli/releases/download/jtk-v$version" - - ./wingetcreate.exe update OpenCLICollective.jira-ticket-cli ` - --version $version ` - --urls "$baseUrl/jtk_${version}_windows_amd64.zip|x64" "$baseUrl/jtk_${version}_windows_arm64.zip|arm64" ` - --submit ` - --token ${{ secrets.WINGET_GITHUB_TOKEN }} + ./wingetcreate.exe submit --path manifests --token ${{ secrets.WINGET_GITHUB_TOKEN }} diff --git a/tools/jtk/packaging/winget/OpenCLICollective.jira-ticket-cli.installer.yaml b/tools/jtk/packaging/winget/OpenCLICollective.jira-ticket-cli.installer.yaml index 36b63de9..298439e3 100644 --- a/tools/jtk/packaging/winget/OpenCLICollective.jira-ticket-cli.installer.yaml +++ b/tools/jtk/packaging/winget/OpenCLICollective.jira-ticket-cli.installer.yaml @@ -10,9 +10,9 @@ NestedInstallerFiles: Installers: - Architecture: x64 InstallerUrl: https://github.com/open-cli-collective/atlassian-cli/releases/download/jtk-v0.0.0/jtk_0.0.0_windows_amd64.zip - InstallerSha256: 0000000000000000000000000000000000000000000000000000000000000000 + InstallerSha256: CHECKSUM_AMD64_PLACEHOLDER - Architecture: arm64 InstallerUrl: https://github.com/open-cli-collective/atlassian-cli/releases/download/jtk-v0.0.0/jtk_0.0.0_windows_arm64.zip - InstallerSha256: 0000000000000000000000000000000000000000000000000000000000000000 + InstallerSha256: CHECKSUM_ARM64_PLACEHOLDER ManifestType: installer ManifestVersion: 1.10.0 diff --git a/tools/jtk/packaging/winget/README.md b/tools/jtk/packaging/winget/README.md index 2b295eb9..f1b5937b 100644 --- a/tools/jtk/packaging/winget/README.md +++ b/tools/jtk/packaging/winget/README.md @@ -1,10 +1,10 @@ # Winget Package for jira-ticket-cli -This directory contains the Winget manifest templates for distributing jira-ticket-cli on Windows via `winget install OpenCLICollective.jira-ticket-cli`. +This directory contains the Winget manifest templates for distributing jtk on Windows via `winget install OpenCLICollective.jira-ticket-cli`. ## Automated Publishing -Publishing to Winget is automated via GitHub Actions. When a new release tag is pushed, the release workflow uses `wingetcreate` to submit a PR to [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs). +Publishing to Winget is automated via GitHub Actions. When a new release tag is pushed, the release workflow copies these templates, substitutes version/checksum placeholders, and uses `wingetcreate submit` to submit a PR to [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs). **Required secret:** `WINGET_GITHUB_TOKEN` - A GitHub PAT with `public_repo` scope, needed to create PRs on microsoft/winget-pkgs. @@ -24,17 +24,29 @@ packaging/winget/ Unlike Chocolatey (which hosts packages on their own feed), Winget manifests live in Microsoft's community repository [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs). Publishing requires submitting a PR to that repo. +## Template Placeholders + +The manifest templates use these placeholders that are replaced during CI: + +| Placeholder | Replaced with | +|-------------|--------------| +| `0.0.0` | Release version (e.g., `0.1.18`) | +| `CHECKSUM_AMD64_PLACEHOLDER` | SHA256 of the x64 zip | +| `CHECKSUM_ARM64_PLACEHOLDER` | SHA256 of the arm64 zip | + +URLs contain `0.0.0` in both the tag path and filename, so the version replacement handles them automatically. + ## Publishing a New Version ### Option 1: Manual PR 1. **Get release info:** - - Download URLs: `https://github.com/open-cli-collective/jira-ticket-cli/releases/download/v/jira-ticket-cli__windows_amd64.zip` + - Download URLs: `https://github.com/open-cli-collective/atlassian-cli/releases/download/jtk-v/jtk__windows_amd64.zip` - SHA256 checksums from `checksums.txt` in the release 2. **Update manifests:** - Replace `0.0.0` with the actual version in all three YAML files - - Replace placeholder checksums with real SHA256 values + - Replace checksum placeholders with real SHA256 values 3. **Validate manifests:** ```powershell @@ -52,19 +64,14 @@ Unlike Chocolatey (which hosts packages on their own feed), Winget manifests liv 7. **Submit PR** to microsoft/winget-pkgs -### Option 2: Using wingetcreate - -[wingetcreate](https://github.com/microsoft/winget-create) can generate manifests from URLs: +### Option 2: Using wingetcreate submit ```powershell # Install wingetcreate winget install Microsoft.WingetCreate -# Create new manifest (interactive) -wingetcreate new https://github.com/open-cli-collective/jira-ticket-cli/releases/download/v/jira-ticket-cli__windows_amd64.zip - -# Or update existing manifest -wingetcreate update OpenCLICollective.jira-ticket-cli --version --urls +# Copy and update templates, then submit +wingetcreate submit --path --token ``` ## Manifest Schema @@ -79,25 +86,16 @@ These manifests use schema version 1.10.0: This package uses: - `InstallerType: zip` - Our releases are zip archives - `NestedInstallerType: portable` - Contains a standalone executable -- `PortableCommandAlias: jira-ticket-cli` - Command users type to invoke the tool +- `PortableCommandAlias: jtk` - Command users type to invoke the tool -Winget extracts the zip, places `jira-ticket-cli.exe` in a managed location, and creates the command alias. +Winget extracts the zip, places `jtk.exe` in a managed location, and creates the command alias. ## Architecture Support | Architecture | Installer URL Pattern | |--------------|----------------------| -| x64 | `jira-ticket-cli__windows_amd64.zip` | -| arm64 | `jira-ticket-cli__windows_arm64.zip` | - -## Manual Retry Workflow - -If automated publishing fails, use the manual workflow: - -1. Go to Actions → "Publish to Winget" -2. Click "Run workflow" -3. Enter the version (e.g., `0.1.0`) -4. Click "Run workflow" +| x64 | `jtk__windows_amd64.zip` | +| arm64 | `jtk__windows_arm64.zip` | ## After Approval From 6c8fca07565e891ebe399c4d2ea5cf9c27153d30 Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Sat, 7 Feb 2026 08:29:19 -0500 Subject: [PATCH 2/2] fix: update winget validation test for named checksum placeholders The test-winget CI was using [regex]::Replace with 0{64} pattern to substitute checksums one at a time. Now that the jtk installer template uses distinct named placeholders (CHECKSUM_AMD64_PLACEHOLDER, CHECKSUM_ARM64_PLACEHOLDER), update the test to match. --- .github/workflows/test-winget.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-winget.yml b/.github/workflows/test-winget.yml index f498596a..75d83cf4 100644 --- a/.github/workflows/test-winget.yml +++ b/.github/workflows/test-winget.yml @@ -79,9 +79,8 @@ jobs: # 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) + $content = $content -replace 'CHECKSUM_AMD64_PLACEHOLDER', $testHash1 + $content = $content -replace 'CHECKSUM_ARM64_PLACEHOLDER', $testHash2 Set-Content "$testDir/OpenCLICollective.jira-ticket-cli.installer.yaml" $content -Encoding UTF8 Write-Host "Validating jtk winget manifest..."