From 617bd092c14e4cf997d99eea9d9ad2c5ce12e8af Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Sat, 11 Oct 2025 17:08:00 -0400 Subject: Set version in binary when creating releases --- ci.bat | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ci.bat') 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% ) -- cgit v1.2.3