We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7dce612 commit b8032a5Copy full SHA for b8032a5
CMakeLists.txt
@@ -55,10 +55,14 @@ add_custom_target(package DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}")
55
# create a release (by pushing a tag to the repository)
56
57
find_program(GIT git REQUIRED)
58
+find_program(GREP grep REQUIRED)
59
60
add_custom_target(
61
release
62
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
63
+ COMMAND "${GIT}" diff-index --quiet HEAD -- # check for uncommitted changes
64
+ COMMAND "${GIT}" branch --show-current | "${GREP}" -qx main # check for main branch
65
+ COMMAND "${GIT}" cherry -v origin/main | "${GREP}" grep -q '^' # check for unpushed commits
66
COMMAND "${GIT}" tag "v${CMAKE_PROJECT_VERSION}"
67
COMMAND "${GIT}" push "v${CMAKE_PROJECT_VERSION}")
68
0 commit comments