ref: 3fc819f60fb716d4d35cc3160a1ada5b208c13ea core/dev/etc/tag-version.sh -rwxr-xr-x 598 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env bash

CONFIG_FILE="dev/include/octaspire/core/octaspire_core_config.h"
STR_MAJOR="define OCTASPIRE_CORE_CONFIG_VERSION_MAJOR"
STR_MINOR="define OCTASPIRE_CORE_CONFIG_VERSION_MINOR"
STR_PATCH="define OCTASPIRE_CORE_CONFIG_VERSION_PATCH"

MAJOR=$(grep "$STR_MAJOR" "$CONFIG_FILE" | awk '{ print $3 }' | sed s/\"//g)
MINOR=$(grep "$STR_MINOR" "$CONFIG_FILE" | awk '{ print $3 }' | sed s/\"//g)
PATCH=$(grep "$STR_PATCH" "$CONFIG_FILE" | awk '{ print $3 }' | sed s/\"//g)

echo "Tag version $MAJOR.$MINOR.$PATCH"
git tag -a "v$MAJOR.$MINOR.$PATCH" -m "Core version $MAJOR.$MINOR.$PATCH"