11@ echo off
22cd %~dp0
3-
3+ SET ROOT = %~dp0
4+ set DRIVE = %~dd0
5+ set WINGET_SRC = %ROOT% ..\winget-pkgs
46for /f " usebackq" %%i in (`xsl -e -s src\Version\version.xsl src\Version\version.props`) do (
57 set VERSION = %%i
68)
79
810set WINGET = 1
9- set APPX_DROPS = D:\XmlNotepadReleases
10- if not exist %APPX_DROPS% mkdir %APPX_DROPS%
1111
1212echo ### Publishing version %VERSION% ...
1313where sed > nul 2 >& 1
@@ -36,20 +36,18 @@ if exist publish\XmlNotepadSetup.zip del publish\XmlNotepadSetup.zip
3636pwsh -command " Compress-Archive -Path src\XmlNotepadSetup\bin\Release\* -DestinationPath publish\XmlNotepadSetup.zip"
3737
3838if not EXIST src\XmlNotepadPackage\AppPackages\%VERSION% \XmlNotepadPackage_%VERSION% _Test\XmlNotepadPackage_%VERSION% _AnyCPU.msixbundle goto :noappx
39- xcopy /y /s src\XmlNotepadPackage\AppPackages\%VERSION% \ %APPX_DROPS% \%VERSION% \
40- if ERRORLEVEL 1 goto :eof
41- copy /y src\XmlNotepadPackage\AppPackages\%VERSION% \index.html %APPX_DROPS%
42- if ERRORLEVEL 1 goto :eof
4339
4440echo Uploading ClickOnce installer to XmlNotepad
4541AzurePublishClickOnce %~dp0 publish downloads/XmlNotepad " %LOVETTSOFTWARE_STORAGE_CONNECTION_STRING% "
4642if ERRORLEVEL 1 goto :eof
4743
4844if " %WINGET% " == " 0" goto :eof
4945
46+ if not exist %WINGET_SRC% goto :nowinget
47+
5048:winget
5149echo Syncing winget master branch
52- pushd d:\git\lovettchris\winget-pkgs \manifests\m\Microsoft\XMLNotepad
50+ pushd %WINGET_SRC% \manifests\m\Microsoft\XMLNotepad
5351git checkout master
5452git pull
5553git fetch upstream master
@@ -58,10 +56,10 @@ git push
5856popd
5957
6058echo Preparing winget package
61- set TARGET = d:\git\lovettchris\winget-pkgs \manifests\m\Microsoft\XMLNotepad\%VERSION% \
59+ set TARGET = %WINGET_SRC% \manifests\m\Microsoft\XMLNotepad\%VERSION% \
6260if not exist %TARGET% mkdir %TARGET%
6361copy /y tools\Microsoft.XMLNotepad*.yaml %TARGET%
64- wingetcreate update Microsoft.XMLNotepad --version %VERSION% -o d:\git\lovettchris\winget-pkgs -u https://github.com/microsoft/XmlNotepad/releases/download/%VERSION% /XmlNotepadPackage_%VERSION% _AnyCPU.msixbundle
62+ wingetcreate update Microsoft.XMLNotepad --version %VERSION% -o %WINGET_SRC% -u https://github.com/microsoft/XmlNotepad/releases/download/%VERSION% /XmlNotepadPackage_%VERSION% _AnyCPU.msixbundle
6563if ERRORLEVEL 1 goto :eof
6664
6765pushd %TARGET%
@@ -103,4 +101,8 @@ exit /b 1
103101
104102:installfailed
105103echo winget install failed
106- exit /b 1
104+ exit /b 1
105+
106+ :nowinget
107+ echo Please clone git@github.com:lovettchris/winget-pkgs.git into %WINGET_SRC%
108+ ecit /b 1
0 commit comments