Closed bs-github closed 1 year ago
maybe this can help: https://github.com/sblantipodi/platformio_version_increment
Maybe the output of git describe
can help which includes the latest git tag plus commit number after that and shortened git hash so that the version is always increasing
With the hint from @okurz, a bit of playing around led to this:
➜ software git:(logging-improvements) ✗ git status
On branch logging-improvements
Your branch is up to date with 'origin/logging-improvements'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: src/modules/ac011k/ac011k.cpp
modified: src/modules/ac011k/ac011k.h
➜ software git:(logging-improvements) ✗ git describe --dirty="-$(git branch --show-current)-$(date "+%Y-%m-%d-%H:%M:%S")"
warpAC011K-2.0.8-176-g7d3594a1-logging-improvements-2023-02-03-10:07:15
Adding the build flags in build.cpp could be another improvement, but has the potential of leaking sensitive information.
The build is suffixed with the timestamp in hex format, but the git commit hash may be more helpful.
Using the build timestamp as defining fact to identify a build is probably less desirable than something that can point to the used code.
Solution I'd like
Additional context
We have to make sure this does not interfere with the build timestamp that is used in the code to make sure the RTC clock is fine.