forked from AaronKelley/PowerMode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
23 lines (18 loc) · 803 Bytes
/
build.bat
File metadata and controls
23 lines (18 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@echo off
echo Building PowerMode...
dotnet publish -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true
if %ERRORLEVEL% neq 0 goto :error
echo Writing build info...
for /f "tokens=*" %%T in ('powershell -Command "Get-Date -Format \"yyyy-MM-dd HH:mm\""') do set "BUILDTIME=%%T"
for /f "tokens=*" %%S in ('powershell -Command "Get-Date -Format \"yyyyMMdd-HHmm\""') do set "BUILDSTAMP=%%S"
echo Built %BUILDTIME% > "bin\Release\net8.0-windows\win-x64\publish\BUILD_INFO.txt"
echo Zipping...
powershell -Command "Get-ChildItem -Path 'bin\Release\net8.0-windows\win-x64\publish' -Exclude '*.pdb' | Compress-Archive -DestinationPath 'PowerMode-%BUILDSTAMP%.zip' -Force"
echo.
echo Build successful!
echo PowerMode-%BUILDSTAMP%.zip
exit /b 0
:error
echo.
echo Build failed!
exit /b 1