Skip to content

Publish MAUI Sherpa to winget and Chocolatey for Windows users #55

@Redth

Description

@Redth

Summary

Make MAUI Sherpa installable for Windows users via winget and Chocolatey, supporting both x64 and arm64 architectures. This mirrors the existing Homebrew tap automation for macOS.

Current State

  • CI already produces MAUI-Sherpa.win-x64.zip and MAUI-Sherpa.win-arm64.zip as self-contained, unpackaged (exe) distributions
  • The create-release job attaches these ZIPs to GitHub Releases
  • The update-homebrew job auto-updates a Homebrew cask on tag push — the same pattern should be replicated for winget and Chocolatey

Implementation Plan

Phase 1: winget

winget requires a multi-file YAML manifest submitted as a PR to microsoft/winget-pkgs.

Package identity: MAUI.Sherpa

Manifest files (in manifests/m/MAUI/Sherpa/{version}/):

  • MAUI.Sherpa.yaml — version manifest
  • MAUI.Sherpa.installer.yaml — installer manifest (x64 + arm64 entries)
  • MAUI.Sherpa.locale.en-US.yaml — default locale manifest

Installer type: zip — since we ship portable ZIPs containing a self-contained exe, the installer type is zip with a NestedInstallerType: portable and NestedInstallerFiles pointing to MauiSherpa.exe.

Sample installer manifest:

PackageIdentifier: MAUI.Sherpa
PackageVersion: 0.3.0
MinimumOSVersion: 10.0.17763.0
InstallerType: zip
NestedInstallerType: portable
Installers:
  - Architecture: x64
    InstallerUrl: https://github.com/Redth/MAUI.Sherpa/releases/download/v0.3.0/MAUI-Sherpa.win-x64.zip
    InstallerSha256: <computed>
    NestedInstallerFiles:
      - RelativeFilePath: MauiSherpa.exe
        PortableCommandAlias: maui-sherpa
  - Architecture: arm64
    InstallerUrl: https://github.com/Redth/MAUI.Sherpa/releases/download/v0.3.0/MAUI-Sherpa.win-arm64.zip
    InstallerSha256: <computed>
    NestedInstallerFiles:
      - RelativeFilePath: MauiSherpa.exe
        PortableCommandAlias: maui-sherpa
ManifestType: installer
ManifestVersion: 1.10.0

Automation: Add an update-winget job to build.yml that runs on tag push (after create-release):

  1. Download the x64 and arm64 ZIPs from the release
  2. Compute SHA256 hashes
  3. Use wingetcreate update to generate updated manifests and submit a PR to microsoft/winget-pkgs
  4. Requires a WINGET_PAT secret (GitHub PAT with public_repo scope for the winget-pkgs fork)
update-winget:
  name: Update winget manifest
  runs-on: windows-latest
  needs: [create-release]
  if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')
  steps:
    - name: Extract version
      run: echo "VERSION=$($env:GITHUB_REF -replace 'refs/tags/v','')" >> $env:GITHUB_ENV

    - name: Install wingetcreate
      run: iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe

    - name: Update manifest and submit PR
      run: |
        $x64Url = "https://github.com/Redth/MAUI.Sherpa/releases/download/v$env:VERSION/MAUI-Sherpa.win-x64.zip"
        $arm64Url = "https://github.com/Redth/MAUI.Sherpa/releases/download/v$env:VERSION/MAUI-Sherpa.win-arm64.zip"
        .\wingetcreate.exe update MAUI.Sherpa -v $env:VERSION -u $x64Url $arm64Url -s -t ${{ secrets.WINGET_PAT }}

Phase 2: Chocolatey

Chocolatey uses a .nuspec + PowerShell install scripts, packaged as a .nupkg and pushed to chocolatey.org.

Package ID: maui-sherpa

Approach: Since we distribute portable ZIPs, use Install-ChocolateyZipPackage to download and extract, then Install-BinFile for PATH shimming. Chocolatey downloads the ZIP from the GitHub Release URL at install time (not embedded in the nupkg).

Required files (new directory packaging/chocolatey/):

packaging/chocolatey/
├── maui-sherpa.nuspec
├── tools/
│   ├── chocolateyInstall.ps1
│   ├── chocolateyUninstall.ps1
│   └── VERIFICATION.txt

Sample chocolateyInstall.ps1:

$ErrorActionPreference = 'Stop'
$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Definition

# Detect architecture
$is64bit = [Environment]::Is64BitOperatingSystem
$isArm = $env:PROCESSOR_ARCHITECTURE -eq 'ARM64' -or $env:PROCESSOR_IDENTIFIER -match 'ARM'

if ($isArm) {
  $archSuffix = 'win-arm64'
} else {
  $archSuffix = 'win-x64'
}

$url = "https://github.com/Redth/MAUI.Sherpa/releases/download/v$env:chocolateyPackageVersion/MAUI-Sherpa.$archSuffix.zip"

Install-ChocolateyZipPackage -PackageName $env:ChocolateyPackageName `
  -Url64bit $url `
  -UnzipLocation $toolsDir

Install-BinFile -Name 'maui-sherpa' -Path (Join-Path $toolsDir 'MauiSherpa.exe')

Automation: Add an update-chocolatey job to build.yml:

  1. Download artifacts, compute checksums
  2. Update version in .nuspec template
  3. Run choco pack and choco push with CHOCO_API_KEY secret
update-chocolatey:
  name: Update Chocolatey package
  runs-on: windows-latest
  needs: [create-release]
  if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')
  steps:
    - uses: actions/checkout@v4
    - name: Extract version
      run: echo "VERSION=$($env:GITHUB_REF -replace 'refs/tags/v','')" >> $env:GITHUB_ENV
    - name: Update nuspec version
      run: |
        (Get-Content packaging/chocolatey/maui-sherpa.nuspec) -replace '<version>.*</version>', "<version>$env:VERSION</version>" |
          Set-Content packaging/chocolatey/maui-sherpa.nuspec
    - name: Pack and push
      run: |
        cd packaging/chocolatey
        choco pack
        choco push maui-sherpa.$env:VERSION.nupkg --source https://push.chocolatey.org/ --api-key ${{ secrets.CHOCO_API_KEY }}

Phase 3: Secrets and Initial Setup

Secret Purpose
WINGET_PAT GitHub PAT with public_repo scope for submitting PRs to microsoft/winget-pkgs
CHOCO_API_KEY Chocolatey.org API key for pushing packages

One-time setup:

  1. winget: Submit the initial manifest PR manually using wingetcreate new. Subsequent versions are automated.
  2. Chocolatey: Register the package on chocolatey.org. First push can be done locally with choco push.

User Experience After Implementation

# winget
winget install MAUI.Sherpa

# Chocolatey
choco install maui-sherpa

Both auto-detect x64 vs arm64 architecture.

Tasks

  • Create initial winget manifest files and submit first PR to microsoft/winget-pkgs
  • Add update-winget job to CI workflow
  • Create packaging/chocolatey/ directory with nuspec and install scripts
  • Add update-chocolatey job to CI workflow
  • Configure WINGET_PAT and CHOCO_API_KEY repository secrets
  • Test end-to-end with a release tag

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions