Skip to content

Commit

Permalink
Update Winget
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacrlevin committed Dec 27, 2023
1 parent 7420a83 commit 9f4d80c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Deploy_Desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ jobs:
$zip86Hash.Hash | Out-File -Encoding 'UTF8' "./StandaloneSigned/PresenceLight.${{ env.VERSION }}-x86.zip.sha256"
$zipARMHash = Get-FileHash "./StandaloneSigned/PresenceLight.${{ env.VERSION }}-win-arm64.zip" -Algorithm SHA256
$zipARMHash.Hash | Out-File -Encoding 'UTF8' "./StandaloneSigned/PresenceLight.${{ env.VERSION }}-win.arm64.zip.sha256"
$zipARMHash.Hash | Out-File -Encoding 'UTF8' "./StandaloneSigned/PresenceLight.${{ env.VERSION }}-win-arm64.zip.sha256"
$appxHash = Get-FileHash "./ReleaseSigned/PresenceLight.Package_${{ env.VERSION }}.0_Test/PresenceLight.Package_${{ env.VERSION }}.0_x64_x86_ARM64.appxbundle" -Algorithm SHA256
$appxHash.Hash | Out-File -Encoding 'UTF8' "./ReleaseSigned/PresenceLight.Package_${{ env.VERSION }}.0_x64_x86_ARM64.appxbundle.sha256"
Expand Down
51 changes: 30 additions & 21 deletions Build/winget/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,38 @@ function Write-MetaData {
$content | Out-File -Encoding 'UTF8' "./$Version/$FileName"
}

New-Item -Path $PWD -Name $Version -ItemType "directory"
# Get all files inside the folder and adjust the version/hash
$Hash = Get-Hash -Version "$Version"
Get-ChildItem '*.yaml' | ForEach-Object -Process {
Write-MetaData -FileName $_.Name -Version $Version -Hash $Hash
}
if (-not $Token) {
return
}
# New-Item -Path $PWD -Name $Version -ItemType "directory"
# # Get all files inside the folder and adjust the version/hash
# $Hash = Get-Hash -Version "$Version"
# Get-ChildItem '*.yaml' | ForEach-Object -Process {
# Write-MetaData -FileName $_.Name -Version $Version -Hash $Hash
# }
# if (-not $Token) {
# return
# }

# # Install the latest wingetcreate exe
# # Need to do things this way, see https://github.com/PowerShell/PowerShell/issues/13138
# Import-Module Appx -UseWindowsPowerShell

# # Download and install C++ Runtime framework package.
# $vcLibsBundleFile = ".\Microsoft.VCLibs.Desktop.appx"
# Invoke-WebRequest https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile $vcLibsBundleFile
# Add-AppxPackage $vcLibsBundleFile

# # Download Winget-Create msixbundle, install, and execute update.
# $appxBundleFile = ".\wingetcreate.msixbundle"
# Invoke-WebRequest https://aka.ms/wingetcreate/latest/msixbundle -OutFile $appxBundleFile
# Add-AppxPackage $appxBundleFile

# Install the latest wingetcreate exe
# Need to do things this way, see https://github.com/PowerShell/PowerShell/issues/13138
Import-Module Appx -UseWindowsPowerShell
$github = Invoke-RestMethod -uri "https://api.github.com/repos/microsoft/devhome/releases"
$targetRelease = $github | Where-Object -Property name -match "Desktop-v$Version" | Select-Object -First 1

# Download and install C++ Runtime framework package.
$vcLibsBundleFile = ".\Microsoft.VCLibs.Desktop.appx"
Invoke-WebRequest https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile $vcLibsBundleFile
Add-AppxPackage $vcLibsBundleFile
$installerUrl = $targetRelease | Select-Object -ExpandProperty assets -First 1 | Where-Object -Property name -match '*.appxbundle' | Select-Object -ExpandProperty browser_download_url

# Download Winget-Create msixbundle, install, and execute update.
$appxBundleFile = ".\wingetcreate.msixbundle"
Invoke-WebRequest https://aka.ms/wingetcreate/latest/msixbundle -OutFile $appxBundleFile
Add-AppxPackage $appxBundleFile
# Update package using wingetcreate
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
.\wingetcreate.exe update "isaaclevin.presencelight" --version $Version --urls "$installerUrl" --submit --token $gitToken

# Create the PR
wingetcreate submit --token $Token $Version
#wingetcreate submit --token $Token $Version

0 comments on commit 9f4d80c

Please sign in to comment.