summaryrefslogtreecommitdiff
path: root/misc/tag-release
blob: c42bbd5a09f78b6f4c7c4c047118024af884253e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

version=""
repo=""
branch=""
push=1

for opt in $*
do
    case "$opt" in
    --ver=*)
        version=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
        ;;
    --repo=*)
        repo=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
        ;;
    --branch=*)
        branch=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'`
        ;;
    --no-push)
        push=0
        ;;
    *)
        version=$opt
        ;;
    esac
done

if [ -z "$version" ]; then
    echo "  Usage"
    echo "      $0 --ver=num [--repo=name --branch=name --push]" 1>&2
    echo "  Example"
    echo "      $0 --ver=2.10rc1 --repo=git+ssh://user@repo.or.cz/nasm.git --branch=master --no-push" 1>&2
    echo "  With --no-push the changes are not pushed out to remote repo"
    exit 1
fi

tag="nasm-$version"

echo "$version" > version
git add version
git commit -m "NASM $version"
git tag -a -m "NASM $version" "$tag"

if [ $push = 1 ]; then
    echo "git push $repo $branch"
    echo "git push $repo $tag"
    echo "git push --tags $repo"
fi