-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #656 from openziti/merge-main-to-1.x
Merge main to 1.x
- Loading branch information
Showing
12 changed files
with
41 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
- release-1.x | ||
|
||
jobs: | ||
update_release_draft: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,49 @@ | ||
|
||
function(get_version version_file version_var branch_var commit_var) | ||
macro(do_git out_var err_var) | ||
execute_process( | ||
COMMAND git describe --tags --match=[0-9]* HEAD | ||
COMMAND "git" ${ARGN} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
OUTPUT_VARIABLE GIT_INFO | ||
OUTPUT_VARIABLE git_out | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
ERROR_VARIABLE git_error | ||
ERROR_VARIABLE git_err | ||
ECHO_ERROR_VARIABLE | ||
) | ||
|
||
if (NOT git_error) | ||
execute_process( | ||
COMMAND git rev-parse --abbrev-ref HEAD | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
OUTPUT_VARIABLE branch | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
# Get the latest abbreviated commit hash of the working branch | ||
execute_process( | ||
COMMAND git log -1 --format=%h | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
OUTPUT_VARIABLE commit | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
if (git_err) | ||
set(${err_var} ${git_err}) | ||
unset(${out_var}) | ||
else () | ||
set(${out_var} "${git_out}") | ||
unset(${err_var}) | ||
endif () | ||
endmacro(do_git) | ||
|
||
if (git_error) | ||
function(get_version version_file version_var branch_var commit_var) | ||
do_git(GIT_INFO GIT_ERROR describe --always) | ||
if (GIT_ERROR) | ||
unset(GIT_INFO) | ||
message("getting version from ${version_file}") | ||
message(NOTICE "getting version from ${version_file}") | ||
file(STRINGS ${version_file} ver_info) | ||
list(LENGTH ver_info ver_info_len) | ||
list(GET ver_info 0 GIT_INFO) | ||
list(GET ver_info 1 branch) | ||
list(GET ver_info 2 commit) | ||
list(GET ver_info 1 _branch) | ||
list(GET ver_info 2 _commit) | ||
set(${version_var} ${GIT_INFO} PARENT_SCOPE) | ||
set(${branch_var} ${_branch} PARENT_SCOPE) | ||
set(${commit_var} ${_commit} PARENT_SCOPE) | ||
return() | ||
endif () | ||
|
||
if (${GIT_INFO} MATCHES "^v?([0-9]+\\.[0-9]+\\.[0-9]+)$") | ||
set(_ver ${CMAKE_MATCH_1}) | ||
elseif (${GIT_INFO} MATCHES "^v?([0-9]+\\.[0-9]+\\.[0-9]+)-([0-9]+)-[^-]*") | ||
string(JOIN "." _ver ${CMAKE_MATCH_1} ${CMAKE_MATCH_2}) | ||
do_git(_branch GIT_ERROR rev-parse --abbrev-ref HEAD) | ||
do_git(GIT_INFO GIT_ERROR describe --tags --long --first-parent HEAD) | ||
if (${GIT_INFO} MATCHES "^(.*)-([0-9]+)-([^-]*)") # <closest tag>-<distance>-<commit> | ||
set(_commit ${CMAKE_MATCH_3}) | ||
if (${CMAKE_MATCH_2} EQUAL "0") #exact tag | ||
set(_ver ${CMAKE_MATCH_1}) | ||
else () | ||
string(JOIN "." _ver ${CMAKE_MATCH_1} ${CMAKE_MATCH_2}) | ||
endif () | ||
endif () | ||
|
||
set(${version_var} ${_ver} PARENT_SCOPE) | ||
set(${branch_var} ${branch} PARENT_SCOPE) | ||
set(${commit_var} ${commit} PARENT_SCOPE) | ||
set(${branch_var} ${_branch} PARENT_SCOPE) | ||
set(${commit_var} ${_commit} PARENT_SCOPE) | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
project(host-proxy) | ||
|
||
add_executable(host-proxy host-proxy.c) | ||
target_link_libraries(host-proxy PRIVATE ziti) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
project(sample-socket) | ||
|
||
add_executable(ziti-ncat ziti-ncat.c) | ||
target_link_libraries(ziti-ncat PUBLIC ziti) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
project(sample-host) | ||
|
||
add_executable(sample-host sample-host.c) | ||
target_link_libraries(sample-host PUBLIC ziti) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
project(sample_enroll) | ||
|
||
add_executable(sample_enroll sample_enroll.c) | ||
target_link_libraries(sample_enroll PUBLIC ziti) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
project(sample_http_link) | ||
|
||
add_executable(sample_http_link sample_http_link.c) | ||
target_link_libraries(sample_http_link PUBLIC ziti) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
project(sample_wttr) | ||
|
||
add_executable(sample_wttr sample_wttr.c) | ||
target_link_libraries(sample_wttr PUBLIC ziti) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
project(wzcat) | ||
|
||
add_executable(wzcat ziti_ws.c) | ||
target_link_libraries(wzcat PUBLIC ziti) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters