Remove "latest" tag from release name

* Also ensure the current tag contains a proper version string.
This commit is contained in:
Jonathan White 2022-04-05 07:14:03 -04:00
parent 7cd824ae1c
commit a98bf1eac3

View File

@ -119,7 +119,8 @@ execute_process(COMMAND git tag --points-at HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_TAG OUTPUT_VARIABLE GIT_TAG
ERROR_QUIET) ERROR_QUIET)
if(GIT_TAG) string(REGEX REPLACE "latest" "" GIT_TAG "${GIT_TAG}")
if(GIT_TAG MATCHES "[0-9]+\.[0-9]+\.[0-9]+")
string(STRIP "${GIT_TAG}" GIT_TAG) string(STRIP "${GIT_TAG}" GIT_TAG)
set(OVERRIDE_VERSION ${GIT_TAG}) set(OVERRIDE_VERSION ${GIT_TAG})
elseif(EXISTS ${CMAKE_SOURCE_DIR}/.version) elseif(EXISTS ${CMAKE_SOURCE_DIR}/.version)
@ -128,14 +129,14 @@ endif()
string(REGEX REPLACE "(\r?\n)+" "" OVERRIDE_VERSION "${OVERRIDE_VERSION}") string(REGEX REPLACE "(\r?\n)+" "" OVERRIDE_VERSION "${OVERRIDE_VERSION}")
if(OVERRIDE_VERSION) if(OVERRIDE_VERSION)
if(OVERRIDE_VERSION MATCHES "^[\\.0-9]+-(alpha|beta)[0-9]+$") if(OVERRIDE_VERSION MATCHES "^[\\.0-9]+-beta[0-9]*")
set(KEEPASSXC_BUILD_TYPE PreRelease) set(KEEPASSXC_BUILD_TYPE "PreRelease")
set(KEEPASSXC_VERSION ${OVERRIDE_VERSION}) set(KEEPASSXC_VERSION ${OVERRIDE_VERSION})
elseif(OVERRIDE_VERSION MATCHES "^[\\.0-9]+$") elseif(OVERRIDE_VERSION MATCHES "^[\\.0-9]+$")
set(KEEPASSXC_BUILD_TYPE Release) set(KEEPASSXC_BUILD_TYPE "Release")
set(KEEPASSXC_VERSION ${OVERRIDE_VERSION}) set(KEEPASSXC_VERSION ${OVERRIDE_VERSION})
else() else()
set(KEEPASSXC_BUILD_TYPE Snapshot) set(KEEPASSXC_BUILD_TYPE "Snapshot")
set(KEEPASSXC_VERSION ${OVERRIDE_VERSION}) set(KEEPASSXC_VERSION ${OVERRIDE_VERSION})
endif() endif()
else() else()