@@ -136,3 +136,44 @@ jobs:
136136 token : ${{ secrets.GH_PAT }}
137137 files : |
138138 *
139+ winget :
140+ runs-on : windows-latest
141+ needs :
142+ - changelog
143+ - release
144+ env :
145+ WINGETCREATE_TOKEN : ${{ secrets.WINGETCREATE_TOKEN }}
146+ steps :
147+ - name : Create manifest and submit PR 📦
148+ shell : pwsh
149+ run : |
150+ Write-Host "Preparing to submit to WinGet repository..." -ForegroundColor Green
151+
152+ # Install the latest wingetcreate exe
153+ # Need to do things this way, see https://github.com/PowerShell/PowerShell/issues/13138
154+ Write-Verbose "Importing Appx module using Windows PowerShell compatibility"
155+ Import-Module Appx -UseWindowsPowerShell -ErrorAction Stop
156+
157+ # Download and install Winget-Create msixbundle
158+ $appxBundleFile = Join-Path -Path $env:TEMP -ChildPath "wingetcreate.msixbundle"
159+ Write-Verbose "Downloading wingetcreate to: $appxBundleFile"
160+
161+ Invoke-WebRequest -Uri "https://aka.ms/wingetcreate/latest/msixbundle" -OutFile $appxBundleFile -ErrorAction Stop
162+ Add-AppxPackage -Path $appxBundleFile -ErrorAction Stop
163+
164+ Write-Verbose "Successfully installed wingetcreate"
165+
166+ # Submit the PR to WinGet repository
167+ Write-Host "Submitting pull request to WinGet repository..." -ForegroundColor Green
168+
169+ $version = "${{ needs.changelog.outputs.tag }}"
170+ $version = $version.TrimStart('v')
171+
172+ $urls = @(
173+ "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-x64.msi|x64",
174+ "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-x64.msix|x64",
175+ "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-arm64.msi|arm64",
176+ "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/v$version/install-arm64.msix|arm64"
177+ )
178+
179+ wingetcreate update JanDeDobbeleer.OhMyPosh --version $version --token $env:WINGETCREATE_TOKEN --submit --urls $urls
0 commit comments