diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-07-20 19:21:40 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-07-20 19:27:31 -0400 |
| commit | e8085aebbfa737be16cb66f81f8c3fef4856d55f (patch) | |
| tree | b360e5588688f52aee465942b6d5dec22e94df1b | |
| parent | c51cafecd6a64698a537b015103f42fd672d7cd9 (diff) | |
Run nightly release with version information
| -rw-r--r-- | .github/workflows/nightly.yml | 9 | ||||
| -rwxr-xr-x | build.sh | 4 | ||||
| -rw-r--r-- | ci.bat | 11 | ||||
| -rwxr-xr-x | ci.sh | 3 | ||||
| -rw-r--r-- | src/main.odin | 2 |
5 files changed, 15 insertions, 14 deletions
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 60de60f..373b83e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,12 +1,11 @@ name: nightly - on: workflow_dispatch: - #schedule: - #- cron: 0 20 * * * -jobs: + schedule: + - cron: 0 2 * * * +jobs: dist-arm64-darwin: runs-on: macos-latest timeout-minutes: 15 @@ -147,7 +146,7 @@ jobs: run: ./ci.bat CI - name: Move to Dist shell: cmd - run: | + run: | mkdir dist move ols.exe dist/ move builtin dist/ @@ -46,8 +46,4 @@ then exit 0 fi -version="$(git describe --tags --abbrev=7)" -version="${version%-*}:${version##*-}" -sed "s|VERSION :: .*|VERSION :: \"${version}\"|g" src/main.odin > /tmp/main.odin.build && mv -f /tmp/main.odin.build src/main.odin - odin build src/ -show-timings -collection:src=src -out:ols -microarch:native -no-bounds-check -o:speed $@ @@ -1,16 +1,21 @@ @echo off setlocal enabledelayedexpansion + +for /f "tokens=1-3 delims=-" %%a in ('echo %date%') do set today=%%a-%%b-%%c +set commit_hash=%GITHUB_SHA:~0,8% +set version=nightly-%today%-%commit_hash% + if "%1" == "CI" ( set "PATH=%cd%\Odin;!PATH!" rem odin test tests -collection:src=src -define:ODIN_TEST_THREADS=1 rem if %errorlevel% neq 0 exit /b 1 - + odin build src\ -collection:src=src -out:ols.exe -o:speed -extra-linker-flags:"/STACK:4000000,2000000" 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" -)
\ No newline at end of file + odin build src\ -collection:src=src -out:ols.exe -o:speed -no-bounds-check -extra-linker-flags:"/STACK:4000000,2000000" -define:VERSION=%version% +) @@ -1,5 +1,6 @@ #!/usr/bin/env bash +VERSION="nightly-$(date -u '+%Y-%m-%d')-$(git rev-parse --short HEAD)" if [[ $1 == "CI" ]] then @@ -36,4 +37,4 @@ then fi -odin build src/ -show-timings -collection:src=src -out:ols -no-bounds-check -o:speed $@ +odin build src/ -show-timings -collection:src=src -out:ols -no-bounds-check -o:speed -define:VERSION=$VERSION $@ diff --git a/src/main.odin b/src/main.odin index f28299e..a77b2b4 100644 --- a/src/main.odin +++ b/src/main.odin @@ -19,7 +19,7 @@ import "core:sys/windows" import "src:common" import "src:server" -VERSION :: "dev-2024-11-9:g584f01b" +VERSION := #config(VERSION, "dev") os_read :: proc(handle: rawptr, data: []byte) -> (int, int) { ptr := cast(^os.Handle)handle |