From 3493d69c5bfa41ae4c0b63c58f4ba3c0b252bdf7 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Tue, 26 Apr 2022 10:32:01 +1000 Subject: [PATCH] chore: Further tweaks to version string (#1895) * fix: Only define SUFFIX if PR or BRANCH build Also, only define `VERSION_TAG` if VERSION_TAG exists. * fix: Omit GIT SHA for colorlcd also if a tagged build --- radio/src/stamp.cpp | 2 +- radio/src/stamp.h.in | 4 +--- tools/build-gh.sh | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/radio/src/stamp.cpp b/radio/src/stamp.cpp index 357fdfa5c..a23e41c0a 100644 --- a/radio/src/stamp.cpp +++ b/radio/src/stamp.cpp @@ -49,7 +49,7 @@ const char vers_stamp[] = "VERS" TAB ": Factory firmware (" GIT_STR ")"; #else #if defined(VERSION_TAG) - const char vers_stamp[] = "VERS" TAB ": " VERSION_TAG DISPLAY_VERSION " (" GIT_STR ")"; + const char vers_stamp[] = "VERS" TAB ": " VERSION_TAG DISPLAY_VERSION; #else const char vers_stamp[] = "VERS" TAB ": " VERSION "-" VERSION_SUFFIX DISPLAY_VERSION " (" GIT_STR ")"; #endif diff --git a/radio/src/stamp.h.in b/radio/src/stamp.h.in index 637bbb2e8..484e592b2 100644 --- a/radio/src/stamp.h.in +++ b/radio/src/stamp.h.in @@ -2,9 +2,7 @@ #define TIME "@TIME@" #define VERSION "@VERSION@" #define VERSION_SUFFIX "@VERSION_SUFFIX@" -#if defined(VERSION_TAG) - #define VERSION_TAG "@VERSION_TAG@" -#endif +#cmakedefine VERSION_TAG "@VERSION_TAG@" #define CODENAME "@CODENAME@" #define VERSION_MAJOR @VERSION_MAJOR@ diff --git a/tools/build-gh.sh b/tools/build-gh.sh index a6a2d3d07..4c0370ccb 100755 --- a/tools/build-gh.sh +++ b/tools/build-gh.sh @@ -58,7 +58,7 @@ elif [[ $gh_type = "pull" ]]; then # pull: refs/pull//merge gh_pull_number=PR$(echo "$GITHUB_REF" | awk -F / '{print $3}') export EDGETX_VERSION_SUFFIX=$gh_pull_number -else +elif [[ $gh_type = "heads" ]]; then # heads: refs/heads/ gh_branch=${GITHUB_REF##*/} export EDGETX_VERSION_SUFFIX=$gh_branch