[firmware] Add better versioning scheme
Opened this issue · 0 comments
kbhomes commented
Goals for a better versioning scheme:
- Support a more human-readable identifier (like SemVer)
- Currently using a
uint16_t
as a flat number for the version number - Consider changing to something like
uint64_t
, with a byte pattern such as:- Major: 1 byte
- Minor: 2 bytes
- Patch: 4 bytes
- Metadata: 1 byte (for example,
dev
for local builds,latest
for automatic builds)
- Currently using a
- Automatically bump patch version with every commit (?)
- Automatically create versioned and
latest
GitHub releases on commits- Use
ps2link
's GitHub Actions workflow as an example - Briefly:
- For all commits, create a
latest
release that is tagged asprerelease
- For commits which are tagged
- For all commits, create a
- Use
Not sure what the best strategy is for making sure the versions in the application and in Git stay in sync. Maybe keep major/minor in code, and patch and metadata passed in from the environment. Patch number might be "number of commits since last tag", and tags will always be "<major>.<minor>.0". This could be problematic if the commit history isn't linear -- need to think about that.