Skip to content

Commit 964ab07

Browse files
committed
ci: stamp VCS_DATE at build time (firmware version date)
The rusefi submodule is pinned, so its committed date_stamp.h (VCS_DATE, the firmware version date shown in TunerStudio) is frozen while the TS signature date is generated fresh each build - making the version look stale (e.g. 20260621). Stamp date_stamp.h with today's date before the build in nightly-release, build-matrix and the local build_boards.sh, so the firmware version reflects the actual build date. The submodule set-date.yaml stays disabled (it can't reach the pinned build anyway).
1 parent 3abe314 commit 964ab07

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎.github/workflows/build-matrix.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ jobs:
5757
git config --global url."https://x-access-token:${{ secrets.MY_REPO_PAT }}@github.com/".insteadOf "git@github.com:"
5858
git submodule update --init --force
5959
60+
# The submodule is pinned, so its date_stamp.h (VCS_DATE, the firmware
61+
# version date) is frozen. Stamp today's date so builds report the actual
62+
# build date instead of a stale one. Mirrors ext/rusefi set-date.yaml.
63+
- name: Stamp firmware build date (VCS_DATE)
64+
run: printf '#pragma once\n#define VCS_DATE %s\n' "$(date +%Y%m%d)" > ext/rusefi/firmware/controllers/date_stamp.h
65+
6066
- name: Set run variables
6167
id: set-variables
6268
run: |

‎.github/workflows/nightly-release.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ jobs:
6262
git config --global url."https://x-access-token:${{ secrets.MY_REPO_PAT }}@github.com/".insteadOf "git@github.com:"
6363
git submodule update --init --force
6464
65+
# The submodule is checked out at a pinned commit, so its date_stamp.h
66+
# (VCS_DATE, the firmware version date) is frozen at whenever the submodule
67+
# last ran set-date. Stamp today's date here so nightly builds report the
68+
# actual build date instead of a stale one. Mirrors ext/rusefi set-date.yaml.
69+
- name: Stamp firmware build date (VCS_DATE)
70+
run: printf '#pragma once\n#define VCS_DATE %s\n' "$(date +%Y%m%d)" > ext/rusefi/firmware/controllers/date_stamp.h
71+
6572
- uses: ./ext/rusefi/.github/workflows/custom-board-build
6673
with:
6774
meta_info: ${{ matrix.meta-info }}

‎build_boards.sh‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ fi
5656

5757
echo "=== Boards to build: ${BOARDS[*]} ==="
5858

59+
# The rusefi submodule's date_stamp.h (VCS_DATE, the firmware version date) is
60+
# frozen at whenever set-date last ran. Stamp today's date so local builds
61+
# report the actual build date instead of a stale one, matching the CI stamp.
62+
printf '#pragma once\n#define VCS_DATE %s\n' "$(date +%Y%m%d)" > "$REPO_ROOT/ext/rusefi/firmware/controllers/date_stamp.h"
63+
echo "=== Stamped VCS_DATE=$(date +%Y%m%d) into ext/rusefi/firmware/controllers/date_stamp.h ==="
64+
5965
for BOARD in "${BOARDS[@]}"; do
6066
META="$REPO_ROOT/boards/$BOARD/meta-info.env"
6167
if [ ! -f "$META" ]; then

0 commit comments

Comments
 (0)