Skip to content

Commit

Permalink
cmake: Add support for GitLab run IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
WarmUpTill authored and PatTheMav committed May 4, 2024
1 parent a1289fd commit e3688b7
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit e3688b7

Please sign in to comment.