diff options
| author | ReFil <31960031+ReFil@users.noreply.github.com> | 2023-11-16 07:49:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-16 07:49:39 +0000 |
| commit | cdcec22e609688812bf0f5ac303cc9c6970efb23 (patch) | |
| tree | fa4b666fbc83311089a8ebdb0a7aa0c2b405d2fe /bin/build.sh | |
| parent | 44a42af666dbeee899520b956200137222c8378c (diff) | |
Version compiled FW with automatic macro (#267)
* Version compiled FW with hash
Auto generates a macro to type out version info, local and github compilation now includes commit hash and timestamp in final uf2 files
* Fix local builds
makefile doesn't like the script returning the macro, directed to null for local builds as version.dtsi file accessible
Diffstat (limited to 'bin/build.sh')
| -rwxr-xr-x | bin/build.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/build.sh b/bin/build.sh index ade4767..cd68988 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -3,7 +3,8 @@ set -eu PWD=$(pwd) -TIMESTAMP="${TIMESTAMP:-$(date -u +"%Y%m%d%H%M%S")}" +TIMESTAMP="${TIMESTAMP:-$(date -u +"%Y%m%d%H%M")}" +COMMIT="${COMMIT:-$(echo xxxxxx)}" # West Build (left) west build -s zmk/app -d build/left -b adv360_left -- -DZMK_CONFIG="${PWD}/config" @@ -14,4 +15,4 @@ west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${PWD}/con # Adv360 Right Kconfig file grep -vE '(^#|^$)' build/right/zephyr/.config # Rename zmk.uf2 -cp build/left/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-left.uf2" && cp build/right/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-right.uf2" +cp build/left/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-left.uf2" && cp build/right/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-right.uf2" |
