-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.bat
More file actions
90 lines (78 loc) · 1.93 KB
/
release.bat
File metadata and controls
90 lines (78 loc) · 1.93 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
@echo off
setlocal
title Finora - Release Builder
echo.
echo ==================================================
echo FINORA - RELEASE BUILDER
echo ==================================================
echo.
if not exist "VERSION" (
echo [ERROR] VERSION file not found.
pause
exit /b 1
)
set /p RELEASE_VERSION=<VERSION
if "%RELEASE_VERSION%"=="" (
echo [ERROR] VERSION file is empty.
pause
exit /b 1
)
echo [INFO] Target version: %RELEASE_VERSION%
python --version >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Python was not found in PATH.
pause
exit /b 1
)
if not exist ".venv" (
echo [SETUP] Creating virtual environment...
python -m venv .venv
if %errorlevel% neq 0 (
echo [ERROR] Failed to create virtual environment.
pause
exit /b 1
)
)
echo [INFO] Activating virtual environment...
call .venv\Scripts\activate
if %errorlevel% neq 0 (
echo [ERROR] Failed to activate virtual environment.
pause
exit /b 1
)
echo [INFO] Installing dependencies...
pip install -q -r requirements.txt
if %errorlevel% neq 0 (
echo [ERROR] Failed to install project dependencies.
pause
exit /b 1
)
pip install -q pyinstaller pyinstaller-hooks-contrib
if %errorlevel% neq 0 (
echo [ERROR] Failed to install build dependencies.
pause
exit /b 1
)
echo [INFO] Running tests...
python -m pytest tests -q
if %errorlevel% neq 0 (
echo [ERROR] Tests failed. Release canceled.
pause
exit /b 1
)
echo [INFO] Building executable and installer...
python create_installer.py
if %errorlevel% neq 0 (
echo [ERROR] Release build failed.
pause
exit /b 1
)
echo.
echo ==================================================
echo [SUCCESS] Release %RELEASE_VERSION% generated.
echo ==================================================
echo Executable: dist\Finora\Finora.exe
echo Installer : dist_setup\Finora_Setup_v%RELEASE_VERSION%.exe
echo.
pause
endlocal