From b38a2faf360af6e250d24128ee5bb39739ddaf8a Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Sun, 9 Oct 2022 21:44:27 +0100 Subject: [PATCH] Deal with auto-associating app for release on GitHub Former-commit-id: 557f15d05f7ac4396f6b7607f2be46d9a27ef979 --- scripts/Create-DraftRelease.ps1 | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/Create-DraftRelease.ps1 b/scripts/Create-DraftRelease.ps1 index d0b38a8d..f54154ef 100644 --- a/scripts/Create-DraftRelease.ps1 +++ b/scripts/Create-DraftRelease.ps1 @@ -343,8 +343,21 @@ if ($dryrun -or $buildonly -or $release.assets_url -imatch '^https:') { } else { "`n**WARNING: The app manifest is not correct for building an app for release on GitHub! Please associate the app with 'Association Kiwix' in Visual Studio and try again" "or else run this script with the flag -buildstorerelease`n" - if (-Not $dryrun) { return } - else { "App would exit now if not dryrun.`n" } + $rename_check = Read-Host "Would you like to set the app for a GitHub release? [Y/N]" + $rename_check = -Not ( $rename_check -imatch 'n' ) + if ($rename_check) { + mv $PSScriptRoot/../KiwixWebApp.jsproj $PSScriptRoot/../KiwixWebApp-msstore.jsproj + mv $PSScriptRoot/../package.appxmanifest $PSScriptRoot/../package-msstore.appxmanifest + mv $PSScriptRoot/../KiwixWebApp-github.jsproj $PSScriptRoot/../KiwixWebApp.jsproj + mv $PSScriptRoot/../package-github.appxmanifest $PSScriptRoot/../package.appxmanifest + $appxmanifest = Get-Content -Raw $PSScriptRoot/../package.appxmanifest + if (-Not ($appxmanifest -match "Publisher=['`"]CN=Association\sKiwix")) { + "`bSomething went wrong! We were not able to associate the app with a GitHub release!" + return + } + } elseif (-Not $dryrun) { + return + } else { "App would exit now if not dryrun.`n" } } } else { "`nBe aware that the version you are building is good for public release on GitHub, but not for upload to the Microsoft Store."