Skip to content

Commit e4f891e

Browse files
chore(winget): build and release using wingetcreate
1 parent 15c4cfb commit e4f891e

File tree

6 files changed

+41
-334
lines changed

6 files changed

+41
-334
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

.github/workflows/winget.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

packages/winget/JanDeDobbeleer.OhMyPosh.installer.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

packages/winget/JanDeDobbeleer.OhMyPosh.locale.en-US.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

packages/winget/JanDeDobbeleer.OhMyPosh.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/winget/build.ps1

Lines changed: 0 additions & 230 deletions
This file was deleted.

0 commit comments

Comments
 (0)