Count only firmware-code commits in the -hz.N build identifier
Build and deploy Docs site to GitHub Pages / github-pages (push) Canceled after 0s
Run Unit Tests / nrf52-companion-smoke (push) Canceled after 0s
Run Unit Tests / nrf52-sensor-smoke (push) Canceled after 0s
Run Unit Tests / esp32-sensor-smoke (push) Canceled after 0s
Run Unit Tests / management-reports (push) Canceled after 0s
Run Unit Tests / stm32-companion-smoke (push) Canceled after 0s
Run Unit Tests / bootloader-version (push) Canceled after 0s
Run Unit Tests / test (push) Canceled after 0s
Run Unit Tests / hosted-doc-links (push) Canceled after 0s
Build and deploy Docs site to GitHub Pages / github-pages (push) Canceled after 0s
Run Unit Tests / nrf52-companion-smoke (push) Canceled after 0s
Run Unit Tests / nrf52-sensor-smoke (push) Canceled after 0s
Run Unit Tests / esp32-sensor-smoke (push) Canceled after 0s
Run Unit Tests / management-reports (push) Canceled after 0s
Run Unit Tests / stm32-companion-smoke (push) Canceled after 0s
Run Unit Tests / bootloader-version (push) Canceled after 0s
Run Unit Tests / test (push) Canceled after 0s
Run Unit Tests / hosted-doc-links (push) Canceled after 0s
Merge commits and commits that touch only the build-setup files (local_build.sh, local_version.py, platformio.local.ini) no longer bump the identifier, and setup-file edits no longer mark a build .dirty, so a branch that only carries settings builds as the plain fork version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C6JeNqcQRUMo2vt6vFBmhk
This commit is contained in:
1 parent
675e40575d
commit
0030aec8dd
1 file changed
+12
-5
+12
-5
@@ -45,9 +45,12 @@ cd "$(dirname "$0")"
|
||||
# VERSION follows the fork's own numbering: the highest vX.Y.Z.W tag reachable
|
||||
# from HEAD (e.g. v1.17.1.10 from rak4631-full-companion-v1.17.1.10-preview3).
|
||||
# Local code changes add an identifier; build settings (untracked files) don't:
|
||||
# -hz.N N local commits not in the maintainer's fork (upstream/keymindCascade;
|
||||
# origin is the personal Gitea copy, so @{upstream} would hide them)
|
||||
# .dirty uncommitted edits to tracked files
|
||||
# -hz.N N of your own commits that change firmware code relative to the
|
||||
# maintainer's fork (upstream/keymindCascade; origin is the personal
|
||||
# Gitea copy, so @{upstream} would hide them)
|
||||
# .dirty uncommitted edits to tracked firmware code
|
||||
# Merge commits and the build-setup files below don't count: they change
|
||||
# settings, not code. Edit LOCAL_FW_SETUP_PATHS if you add more setup files.
|
||||
# CORE is the upstream MeshCore version from examples/simple_repeater/MyMesh.h.
|
||||
LOCAL_FW_NAME=hazelwood
|
||||
|
||||
@@ -60,11 +63,15 @@ if [ -z "$fork_version" ]; then
|
||||
fi
|
||||
local_id=""
|
||||
LOCAL_FW_UPSTREAM_REF=${LOCAL_FW_UPSTREAM_REF:-upstream/keymindCascade}
|
||||
local_commits=$(git rev-list --count "${LOCAL_FW_UPSTREAM_REF}..HEAD" 2>/dev/null || echo 0)
|
||||
LOCAL_FW_SETUP_PATHS=":(exclude)local_build.sh :(exclude)local_version.py :(exclude)platformio.local.ini"
|
||||
# shellcheck disable=SC2086 # intentional word-splitting of the pathspec list
|
||||
local_commits=$(git rev-list --count --no-merges "${LOCAL_FW_UPSTREAM_REF}..HEAD" \
|
||||
-- . $LOCAL_FW_SETUP_PATHS 2>/dev/null || echo 0)
|
||||
if [ "$local_commits" -gt 0 ]; then
|
||||
local_id="-hz.${local_commits}"
|
||||
fi
|
||||
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
|
||||
# shellcheck disable=SC2086
|
||||
if [ -n "$(git status --porcelain --untracked-files=no -- . $LOCAL_FW_SETUP_PATHS)" ]; then
|
||||
local_id="${local_id:--hz}.dirty"
|
||||
fi
|
||||
LOCAL_FW_VERSION="v${fork_version}${local_id}"
|
||||
|
||||
Reference in new issue
Block a user