Sets explicit "nightly" suffix for GitHub nightly builds#1903
Conversation
|
Can always run it locally... I was thinking perhaps more like this... i.e. don't even do any of the processing if it's already set? diff --git a/tools/build-gh.sh b/tools/build-gh.sh
index 2a00c1fcd..fa612f911 100755
--- a/tools/build-gh.sh
+++ b/tools/build-gh.sh
@@ -48,25 +48,28 @@ fi
: ${SRCDIR:=$(dirname "$(pwd)/$0")/..}
-gh_type=$(echo "$GITHUB_REF" | awk -F / '{print $2}') #heads|tags|pull
-
-if [[ $gh_type = "tags" ]]; then
- # tags: refs/tags/<tag_name>
- gh_tag=${GITHUB_REF##*/}
- export EDGETX_VERSION_TAG=$gh_tag
-elif [[ $gh_type = "pull" ]]; then
- # pull: refs/pull/<pr_number>/merge
- gh_pull_number=PR$(echo "$GITHUB_REF" | awk -F / '{print $3}')
- export EDGETX_VERSION_SUFFIX=$gh_pull_number
-elif [[ $gh_type = "heads" ]]; then
- # heads: refs/heads/<branch_name>
- # replace it with branch_name only, if EDGETX_VERSION_SUFFIX is already not set
- if [[ -z ${EDGETX_VERSION_SUFFIX} ]]; then
+# Generate EDGETX_VERSION_SUFFIX if not already set
+if [[ -z ${EDGETX_VERSION_SUFFIX} ]]; then
+ gh_type=$(echo "$GITHUB_REF" | awk -F / '{print $2}') #heads|tags|pull
+
+ if [[ $gh_type = "tags" ]]; then
+ # tags: refs/tags/<tag_name>
+ gh_tag=${GITHUB_REF##*/}
+ export EDGETX_VERSION_TAG=$gh_tag
+ elif [[ $gh_type = "pull" ]]; then
+ # pull: refs/pull/<pr_number>/merge
+ gh_pull_number=PR$(echo "$GITHUB_REF" | awk -F / '{print $3}')
+ export EDGETX_VERSION_SUFFIX=$gh_pull_number
+ elif [[ $gh_type = "heads" ]]; then
+ # heads: refs/heads/<branch_name>
gh_branch=${GITHUB_REF##*/}
export EDGETX_VERSION_SUFFIX=$gh_branch
- fi
-fi
+ fi
+fi
+echo $EDGETX_VERSION_TAG #testing only
+echo $EDGETX_VERSION_SUFFIX #testing only
+exit #testing only
: ${BUILD_TYPE:=Release}
: ${COMMON_OPTIONS:="-DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_RULE_MESSAGES=OFF -Wno-dev "}
: ${EXTRA_OPTIONS:="$EXTRA_OPTIONS"}
|
|
I like the idea of setting EDGETX_VERSION_SUFFIX only, if not already explicitly set, so changed to your suggestion. Please see last commit, if worthy for merging. Thx! |
|
Just loaded the nightly for the Zorro, is correctly marked as nightly :) |
|
Indeed, looking good. Tests with TX16S mkII: From this PR: Action result, after this PR was merged and I flashed the binary that was built in GitHub: Today's nightly: 😄 I wonder though, if we should now revert the change I introduced in #1850 to: |
|
I'd have to have a proper look, but I think so. Tag existence should trigger any "release" logic thus no need for the suffix to be set to release. The next thing to check up on now is how Companion shows the version, so might as well do that all in one PR. |
|
Started testing with Companion. When building current main locally with MSYS2, this is the output under Windows: (this should ideally have a selfbuild suffix) And this is the output of the self-built Windows TX16S Simulator library: Next, downloaded Windows Companion binary from https://github.com/EdgeTX/edgetx/actions/runs/2232773279 (main branch GitHub build): As TX16S simu lib is presently not included in Windows Companion installer package (bug), tried with Zorro: (notice the wrong |
* Sets explicit "nightly" suffix for GitHub nightly builds. * Extract and set EDGETX_VERSION_SUFFIX only, if not already set










Tries to augment #1850, #1887 and #1895 by adding explicit "nightly" suffix for GitHub nightly builds.
Real-life testing possible likely only after merging and waiting for the nightly to be generated.