Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: Fix potential configure error when setting up buildnumber #122

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
cmake: Add support for GitLab run IDs
  • Loading branch information
WarmUpTill committed Apr 29, 2024
commit 81a96676df194808f4f8c27ccf86a22e8d0bda27
10 changes: 8 additions & 2 deletions cmake/common/buildnumber.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ if(NOT DEFINED PLUGIN_BUILD_NUMBER AND EXISTS "${_BUILD_NUMBER_CACHE}")
file(READ "${_BUILD_NUMBER_CACHE}" PLUGIN_BUILD_NUMBER)
math(EXPR PLUGIN_BUILD_NUMBER "${PLUGIN_BUILD_NUMBER}+1")
elseif(NOT DEFINED PLUGIN_BUILD_NUMBER)
if($ENV{CI} AND $ENV{GITHUB_RUN_ID})
set(PLUGIN_BUILD_NUMBER "$ENV{GITHUB_RUN_ID}")
if($ENV{CI})
if($ENV{GITHUB_RUN_ID})
set(PLUGIN_BUILD_NUMBER "$ENV{GITHUB_RUN_ID}")
elseif($ENV{GITLAB_RUN_ID})
set(PLUGIN_BUILD_NUMBER "$ENV{GITLAB_RUN_ID}")
else()
set(PLUGIN_BUILD_NUMBER "1")
endif()
else()
set(PLUGIN_BUILD_NUMBER "1")
endif()
Expand Down