-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-dashboard.cmd
More file actions
97 lines (81 loc) · 3.1 KB
/
build-dashboard.cmd
File metadata and controls
97 lines (81 loc) · 3.1 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
@echo off
setlocal enabledelayedexpansion
cd /d "%~dp0"
echo.
echo ========================================
echo Building Full Edition (Dashboard + Installers)
echo ========================================
echo.
:: Get version from csproj
for /f %%a in ('powershell -Command "([xml](Get-Content Dashboard\Dashboard.csproj)).Project.PropertyGroup.Version | Where-Object { $_ }"') do set VERSION=%%a
echo Version: %VERSION%
echo.
if not exist "releases" mkdir releases
:: ----------------------------------------
:: Dashboard
:: ----------------------------------------
echo [1/3] Publishing Dashboard...
dotnet publish Dashboard\Dashboard.csproj -c Release -o publish\Dashboard
if %ERRORLEVEL% neq 0 (
echo.
echo ERROR: Dashboard build failed!
exit /b 1
)
echo Creating Dashboard ZIP...
set DASH_ZIP=PerformanceMonitorDashboard-%VERSION%.zip
if exist "releases\%DASH_ZIP%" del "releases\%DASH_ZIP%"
powershell -Command "Compress-Archive -Path 'publish\Dashboard\*' -DestinationPath 'releases\%DASH_ZIP%' -Force"
echo.
:: ----------------------------------------
:: CLI Installer
:: ----------------------------------------
echo [2/3] Publishing CLI Installer...
dotnet publish Installer\PerformanceMonitorInstaller.csproj -c Release
if %ERRORLEVEL% neq 0 (
echo.
echo ERROR: CLI Installer build failed!
exit /b 1
)
echo.
:: ----------------------------------------
:: GUI Installer
:: ----------------------------------------
echo [3/3] Publishing GUI Installer...
dotnet publish InstallerGui\InstallerGui.csproj -c Release -r win-x64 --self-contained
if %ERRORLEVEL% neq 0 (
echo.
echo ERROR: GUI Installer build failed!
exit /b 1
)
echo.
:: ----------------------------------------
:: Package Installer + SQL into ZIP
:: ----------------------------------------
echo Packaging Installer + SQL scripts...
set INST_DIR=publish\Installer
if exist "%INST_DIR%" rmdir /S /Q "%INST_DIR%"
mkdir "%INST_DIR%"
mkdir "%INST_DIR%\install"
mkdir "%INST_DIR%\upgrades"
copy "Installer\bin\Release\net8.0\win-x64\publish\PerformanceMonitorInstaller.exe" "%INST_DIR%\" >nul
copy "InstallerGui\bin\Release\net8.0\win-x64\publish\InstallerGui.exe" "%INST_DIR%\" >nul 2>&1
copy "install\*.sql" "%INST_DIR%\install\" >nul
xcopy "upgrades" "%INST_DIR%\upgrades\" /E /I /Q >nul 2>&1
if exist README.md copy README.md "%INST_DIR%\" >nul
if exist LICENSE copy LICENSE "%INST_DIR%\" >nul
if exist THIRD_PARTY_NOTICES.md copy THIRD_PARTY_NOTICES.md "%INST_DIR%\" >nul
set INST_ZIP=PerformanceMonitorInstaller-%VERSION%.zip
if exist "releases\%INST_ZIP%" del "releases\%INST_ZIP%"
powershell -Command "Compress-Archive -Path 'publish\Installer\*' -DestinationPath 'releases\%INST_ZIP%' -Force"
echo.
echo ========================================
echo Build Complete!
echo ========================================
echo.
echo Output:
echo releases\%DASH_ZIP%
echo releases\%INST_ZIP%
echo.
for %%A in ("releases\%DASH_ZIP%") do echo Dashboard size: %%~zA bytes
for %%A in ("releases\%INST_ZIP%") do echo Installer size: %%~zA bytes
endlocal