-
Notifications
You must be signed in to change notification settings - Fork 5
/
do-release.bat
37 lines (31 loc) · 1.21 KB
/
do-release.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
@echo off
setlocal enableDelayedExpansion
rem Run from VS command prompt
rem Build release binaries
msbuild u2t.sln /verbosity:minimal /t:Clean;Rebuild /property:Configuration=Release /property:Platform=x86
if !ERRORLEVEL! NEQ 0 goto Error
msbuild u2t.sln /verbosity:minimal /t:Clean;Rebuild /property:Configuration=Release /property:Platform=x64
if !ERRORLEVEL! NEQ 0 goto Error
msbuild u2t.sln /verbosity:minimal /t:Clean;Rebuild /property:Configuration=Release /property:Platform=ARM64
if !ERRORLEVEL! NEQ 0 goto Error
rem Sign the binaries
set FILES_TO_SIGN=
for /r "%CD%" %%f in (Release\*.exe) do (
set FILES_TO_SIGN=!FILES_TO_SIGN! %%f
)
signtool sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /sha1 b28642b756ebec4884d1063dfa4de803a6dcecdc /v !FILES_TO_SIGN!
if !ERRORLEVEL! NEQ 0 goto Error
rem Zip the binaries
del u2t-*.zip
if !ERRORLEVEL! NEQ 0 goto Error
7z a u2t-x86.zip .\Release\*.exe .\Release\*.pdb
if !ERRORLEVEL! NEQ 0 goto Error
7z a u2t-x64.zip .\x64\Release\*.exe .\x64\Release\*.pdb
if !ERRORLEVEL! NEQ 0 goto Error
7z a u2t-arm64.zip .\ARM64\Release\*.exe .\ARM64\Release\*.pdb
if !ERRORLEVEL! NEQ 0 goto Error
echo Build successful!
exit /b 0
:Error
echo Build failed!
exit /b !ERRORLEVEL!