Skip to content

Commit 1d8cbc1

Browse files
committed
Change develop to latest and other branch will get the tag to decide which
version it is staying on
1 parent fe49e46 commit 1d8cbc1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cmake/version.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ while ("${PADDLE_VERSION}" STREQUAL "")
1111
RESULT_VARIABLE GIT_RESULT
1212
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
1313
if (NOT ${GIT_RESULT})
14+
# Get current branch name
15+
execute_process(
16+
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref ${tmp_version}
17+
WORKING_DIRECTORY ${PADDLE_SOURCE_DIR}
18+
OUTPUT_VARIABLE GIT_BRANCH_NAME
19+
RESULT_VARIABLE GIT_BRANCH_RESULT
20+
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
21+
# If current branch is develop, then version will be latest
22+
if (NOT ${GIT_BRANCH_RESULT})
23+
if (${GIT_BRANCH_NAME} MATCHES "develop")
24+
set(PADDLE_VERSION "latest")
25+
continue()
26+
endif()
27+
endif()
1428
# Check the tag is a correct version
1529
if (${GIT_TAG_NAME} MATCHES "${COMMIT_VERSION_REGEX}")
1630
# if no tag was found, set PADDLE_VERSION to latest

0 commit comments

Comments
 (0)