sylefeb/Silice

Versioning

sylefeb opened this issue · 1 comments

A versioning approach needs to be defined:

  • tags on master branch on new versions (when merging from wip), where the tag is an actual version string (good practices?)
  • --version should display these
  • versions in wip and draft could say wip-<hash> or draft-<hash>

Hi.
maybe adding, in compile_silice_linux.sh, something like do the job:

BRANCH=$(git branch --show-current)
if [ $BRANCH == "master" ]; then
    GIT_VERS=$(git describe --tags)
else
    GIT_VERS="$BRANCH-$(git rev-parse --short $(git branch --show-current))"
fi
cmake -DGIT_VERS=$GIT_VERS -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../..

Ok it's linux only but a similar piece of code may works for others OS.