-
Notifications
You must be signed in to change notification settings - Fork 39
/
publish.bat
47 lines (24 loc) · 1.15 KB
/
publish.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
@echo off
set token=%1
set targetURL=%2
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build"
call vcvarsall x86
popd
echo 'The current version on the server is '
FOR /F %%H IN ('Powershell.exe -executionpolicy remotesigned -Command ".\Deployment\GetVersion.ps1 %targetURL%"') DO set VERSION=%%H
cd "Window Walker"
powershell -Command "(New-Object System.Net.WebClient).DownloadFile(\"https://dist.nuget.org/win-x86-commandline/latest/nuget.exe\", \".\nuget.exe\")"
.\nuget.exe restore "Window Walker.sln"
msbuild /target:publish /p:Configuration=Release /property:ApplicationVersion=%VERSION% /p:Platform="Any CPU" /property:PublishUrl=".\..\Deployment\Deployment\"
cd ..
IF EXIST .\Deployment\Deployment (
rmdir /s .\Deployment\Deployment /Q
)
mkdir .\Deployment\Deployment
xcopy ".\Window Walker\Window Walker\bin\Release\app.publish\*" ".\Deployment\Deployment\" /y /s
echo %VERSION%>.\Deployment\Deployment\version.txt
cd .\Deployment
REM for /f %%i in ('now') do set uniqueurl=%%i
powershell -Command "npm i -g now"
FOR /F %%G IN ('now --token %token% .') DO now --token %token% alias %%G %targetURL%
cd ..