1#!/bin/bash
2
3if [ "$1" == "" ]; then
4	echo "Error: No version provided"
5	echo "./makerelease 0.0.1"
6	exit 1
7fi
8
9ssh -T git@github.com
10if [ ! "$?" = "1" ]; then
11  echo "No Github ssh key loaded exiting..."
12  exit 1
13fi
14
15clear
16branch=$(git rev-parse --abbrev-ref HEAD)
17read -p "Current branch is $branch. Continue ? (y/N)" choice
18case "$choice" in
19  n|N|'' )
20    echo "Cancel !"
21    exit 1
22  ;;
23  y|Y ) echo "Make release...";;
24  * )
25    echo "Cancel !"
26    exit 1
27  ;;
28esac
29
30
31
32# Ready to update :
33
34version=$1
35
36sed -i "/string version = /c\\\tstring version = \"$version\";" src/helpers/help.cpp
37IFS='.' read -ra VPART <<< "$version"
38sed -i "/MAJOR=/cMAJOR=${VPART[0]}" makefile
39sed -i "/MINOR=/cMINOR=${VPART[1]}" makefile
40sed -i "/MICRO=/cMICRO=${VPART[2]}" makefile
41
42git commit -m "Version $version" makefile src/*
43git push
44
45git checkout master
46git merge develop
47git push
48
49git tag -a "v$version" -m "Version $version"
50git push --tags
51
52git checkout $branch
53
54#wget https://github.com/MatMoul/g810-led/archive/v$version.zip
55#wget https://github.com/MatMoul/g810-led/archive/v$version.tar.gz
56
57#Publish to aur...
58