Lines Matching +full:rev +full:- +full:parse
3 set -e # Fail on error
4 set -u # Treat unset variables as an error and exit immediately
11 echo -e "${ACTION}Checking environnement${NOCOLOR}"
12 if [[ ! $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
14 echo -e "${ERROR}Invalid version number. Aborting. ${NOCOLOR}"
18 declare -r VERSION=$1
19 declare -r GIT_TAG="v$1"
21 BRANCH=$(git rev-parse --abbrev-ref HEAD)
24 echo -e "${ERROR}Not on main. Aborting. ${NOCOLOR}"
30 HEADHASH=$(git rev-parse HEAD)
31 UPSTREAMHASH=$(git rev-parse main@{upstream})
35 echo -e "${ERROR}Not up to date with origin. Aborting.${NOCOLOR}"
40 git update-index -q --refresh
41 if ! git diff-index --quiet HEAD --
43 echo -e "${ERROR}Branch has uncommited changes. Aborting.${NOCOLOR}"
47 if [ ! -z "$(git ls-files --exclude-standard --others)" ]
49 echo -e "${ERROR}Branch has untracked files. Aborting.${NOCOLOR}"
53 declare -r LATEST_GIT_TAG=$(git describe --tags --abbrev=0)
54 declare -r LATEST_VERSION=${LATEST_GIT_TAG#"v"}
56 if ! dpkg --compare-versions "${VERSION}" "gt" "${LATEST_VERSION}"
58 echo -e "${ERROR}Invalid version ${VERSION} <= ${LATEST_VERSION} (latest). Aborting.${NOCOLOR}"
62 echo -e "${ACTION}Modifying CMakeLists.txt${NOCOLOR}"
63 sed -i "s/CpuFeatures VERSION ${LATEST_VERSION}/CpuFeatures VERSION ${VERSION}/g" CMakeLists.txt
65 echo -e "${ACTION}Commit new revision${NOCOLOR}"
67 git commit -m"Release ${GIT_TAG}"
69 echo -e "${ACTION}Create new tag${NOCOLOR}"
72 echo -e "${FINISHED}Manual steps:${NOCOLOR}"
73 echo -e "${FINISHED} - Push the tag upstream 'git push origin ${GIT_TAG}'${NOCOLOR}"
74 echo -e "${FINISHED} - Create a new release https://github.com/google/cpu_features/releases/new${NO…
75 echo -e "${FINISHED} - Update the Release Notes 'gren release --override'${NOCOLOR}"