feat(firmware): Set "nightly" suffix for GitHub nightly builds (#1903)

* Sets explicit "nightly" suffix for GitHub nightly builds.

* Extract and set EDGETX_VERSION_SUFFIX only, if not already set
This commit is contained in:
Risto
2022-04-26 20:44:44 +10:00
committed by GitHub
parent 3493d69c5b
commit f2b07ddf1b
2 changed files with 17 additions and 14 deletions
+1
View File
@@ -45,6 +45,7 @@ jobs:
- name: Build firmware ${{ matrix.target }}
env:
FLAVOR: ${{ matrix.target }}
EDGETX_VERSION_SUFFIX: nightly
run: ./tools/build-gh.sh
- name: Package firmware ${{ matrix.target }}
+16 -14
View File
@@ -48,20 +48,22 @@ 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>
gh_branch=${GITHUB_REF##*/}
export EDGETX_VERSION_SUFFIX=$gh_branch
# 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
: ${BUILD_TYPE:=Release}