aboutsummaryrefslogtreecommitdiff
path: root/ci.bat
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-11 17:08:00 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-11 18:02:25 -0400
commit617bd092c14e4cf997d99eea9d9ad2c5ce12e8af (patch)
treedaa46fa8ee9d867b28ecab7b24693a986db9aad9 /ci.bat
parent44f7dedc6ab60a39ffe7ba0b1838a6251654b16e (diff)
Set version in binary when creating releases
Diffstat (limited to 'ci.bat')
-rw-r--r--ci.bat13
1 files changed, 7 insertions, 6 deletions
diff --git a/ci.bat b/ci.bat
index 90dea49..9466d7c 100644
--- a/ci.bat
+++ b/ci.bat
@@ -2,20 +2,21 @@
setlocal enabledelayedexpansion
-for /f %%a in ('git rev-parse --short HEAD 2^>NUL') do set commit_hash=%%a
-for /f %%d in ('powershell -command "[DateTime]::UtcNow.ToString('yyyy-MM-dd')"') do set today=%%d
-set version=nightly-%today%-%commit_hash%
-
+if not defined OLS_VERSION (
+ for /f %%a in ('git rev-parse --short HEAD 2^>NUL') do set commit_hash=%%a
+ for /f %%d in ('powershell -command "[DateTime]::UtcNow.ToString('yyyy-MM-dd')"') do set today=%%d
+ set "OLS_VERSION=nightly-!today!-!commit_hash!"
+)
if "%1" == "CI" (
set "PATH=%cd%\Odin;!PATH!"
odin test tests -collection:src=src -define:ODIN_TEST_THREADS=1
if %errorlevel% neq 0 exit /b 1
- odin build src\ -collection:src=src -out:ols.exe -o:speed -no-bounds-check -extra-linker-flags:"/STACK:4000000,2000000" -define:VERSION=%version%
+ odin build src\ -collection:src=src -out:ols.exe -o:speed -no-bounds-check -extra-linker-flags:"/STACK:4000000,2000000" -define:VERSION=%OLS_VERSION%
call "tools/odinfmt/tests.bat"
if %errorlevel% neq 0 exit /b 1
) else (
- odin build src\ -collection:src=src -out:ols.exe -o:speed -no-bounds-check -extra-linker-flags:"/STACK:4000000,2000000" -define:VERSION=%version%
+ odin build src\ -collection:src=src -out:ols.exe -o:speed -no-bounds-check -extra-linker-flags:"/STACK:4000000,2000000" -define:VERSION=%OLS_VERSION%
)