From c8cf737adce1de0722e00c468ae6080047b8dfcf Mon Sep 17 00:00:00 2001 From: Rian Stockbower Date: Sat, 17 Jan 2026 07:17:43 -0500 Subject: [PATCH] feat: automate Winget package submission - Add manual workflow for initial/retry submissions - Add winget job to release workflow for automatic submission - Update documentation Closes #77 --- .github/workflows/release.yml | 22 ++++++++++++++ .github/workflows/winget-publish.yml | 43 ++++++++++++++++++++++++++++ CLAUDE.md | 2 +- packaging/winget/README.md | 8 ++++++ 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/winget-publish.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 870a0db..24ece08 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,3 +55,25 @@ jobs: run: | cd packaging/chocolatey choco push (Get-ChildItem *.nupkg).Name --source https://push.chocolatey.org/ --key ${{ secrets.CHOCOLATEY_API_KEY }} + + winget: + needs: goreleaser + runs-on: windows-latest + steps: + - name: Install wingetcreate + shell: pwsh + run: | + Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe + + - name: Submit to Winget + shell: pwsh + run: | + $version = "${{ github.ref_name }}".TrimStart('v') + $x64 = "https://github.com/open-cli-collective/confluence-cli/releases/download/${{ github.ref_name }}/cfl_${version}_windows_amd64.zip" + $arm64 = "https://github.com/open-cli-collective/confluence-cli/releases/download/${{ github.ref_name }}/cfl_${version}_windows_arm64.zip" + + Write-Host "Submitting version $version to Winget" + Write-Host "x64 URL: $x64" + Write-Host "arm64 URL: $arm64" + + ./wingetcreate.exe update OpenCLICollective.cfl --version $version --urls $x64 $arm64 --submit --token ${{ secrets.WINGET_GITHUB_TOKEN }} diff --git a/.github/workflows/winget-publish.yml b/.github/workflows/winget-publish.yml new file mode 100644 index 0000000..1fd73ba --- /dev/null +++ b/.github/workflows/winget-publish.yml @@ -0,0 +1,43 @@ +name: Publish to Winget + +on: + workflow_dispatch: + inputs: + version: + description: 'Version to publish (e.g., 0.9.9)' + required: true + type: string + +jobs: + publish: + runs-on: windows-latest + steps: + - name: Install wingetcreate + shell: pwsh + run: | + Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe + + - name: Validate release exists + shell: pwsh + env: + GH_TOKEN: ${{ github.token }} + run: | + $release = gh release view "v${{ inputs.version }}" --repo open-cli-collective/confluence-cli --json tagName 2>&1 + if ($LASTEXITCODE -ne 0) { + Write-Error "Release v${{ inputs.version }} not found" + exit 1 + } + Write-Host "Found release v${{ inputs.version }}" + + - name: Submit to Winget + shell: pwsh + run: | + $version = "${{ inputs.version }}" + $x64 = "https://github.com/open-cli-collective/confluence-cli/releases/download/v$version/cfl_${version}_windows_amd64.zip" + $arm64 = "https://github.com/open-cli-collective/confluence-cli/releases/download/v$version/cfl_${version}_windows_arm64.zip" + + Write-Host "Submitting version $version to Winget" + Write-Host "x64 URL: $x64" + Write-Host "arm64 URL: $arm64" + + ./wingetcreate.exe update OpenCLICollective.cfl --version $version --urls $x64 $arm64 --submit --token ${{ secrets.WINGET_GITHUB_TOKEN }} diff --git a/CLAUDE.md b/CLAUDE.md index 9ab935b..67e5ce2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -222,4 +222,4 @@ packaging/ - **Homebrew**: Automated via GoReleaser, published to [open-cli-collective/homebrew-tap](https://github.com/open-cli-collective/homebrew-tap) - **Chocolatey**: Automated via release workflow, requires `CHOCOLATEY_API_KEY` secret -- **Winget**: Manual PR submission to [microsoft/winget-pkgs](https://github.com/microsoft/winget-pkgs), documented in `packaging/winget/README.md` +- **Winget**: Automated via release workflow, requires `WINGET_GITHUB_TOKEN` secret (PAT with `public_repo` scope) diff --git a/packaging/winget/README.md b/packaging/winget/README.md index 7f11b58..2c851df 100644 --- a/packaging/winget/README.md +++ b/packaging/winget/README.md @@ -2,6 +2,14 @@ This directory contains the Winget manifest templates for distributing confluence-cli on Windows via `winget install OpenCLICollective.cfl`. +## 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). + +**Required secret:** `WINGET_GITHUB_TOKEN` - A GitHub PAT with `public_repo` scope, needed to create PRs on microsoft/winget-pkgs. + +**Note:** Unlike Chocolatey (direct publish), Winget submissions are PRs that go through Microsoft's automated validation before merging. + ## Manifest Structure ```