release 870 Bytes
Newer Older
gerd's avatar
gerd committed
1 2 3 4
#! /bin/sh

set -e

gerd's avatar
gerd committed
5 6
version="$(./configure -version)"
echo "$version" >RELEASE
gerd's avatar
gerd committed
7 8 9 10 11 12 13 14 15

destdir="xstrp4-$version"

mkdir -p packages
rm -rf "packages/$destdir"
makepkg -spec xstrp4.files -intree . -outtree "packages/$destdir"
(cd packages; tar czf "$destdir.tar.gz" "$destdir")
echo "Wrote packages/$destdir.tar.gz"

Gerd Stolpmann's avatar
Gerd Stolpmann committed
16 17 18 19 20
master="$(git branch | grep '* master')"
if [ -z "$master" ]; then
    echo "Error: not on master branch"
    exit 1
fi
gerd's avatar
gerd committed
21

Gerd Stolpmann's avatar
Gerd Stolpmann committed
22
status="$(git status -uno -s)"
gerd's avatar
gerd committed
23 24

if [ -n "$status" ]; then
Gerd Stolpmann's avatar
Gerd Stolpmann committed
25
    echo "Error: git status not clean"
gerd's avatar
gerd committed
26 27 28 29 30
    exit 1
else
    printf "Tag revision (y/n)? "
    read answer
    case "$answer" in
Gerd Stolpmann's avatar
Gerd Stolpmann committed
31 32 33 34 35 36 37 38
        y|Y|yes|YES)
            git tag -a -m "xstrp4-$version" xstrp4-$version
            git push --tags origin master
            echo "New tag: xstrp4-$version"
            ;;
        *)
            echo "Nothing tagged."
            ;;
gerd's avatar
gerd committed
39 40
    esac
fi