39 lines
1.1 KiB
Bash
Executable File

#!/bin/sh -ex
VERSION=$1
if test -z "$VERSION"; then
echo $0: usage: $0 version
exit 1
fi
if test -n "$(git status --porcelain)"; then
echo $0: git status is wordy, you probably want to stash and note your branch
exit 2
fi
dch -b -v 1:${VERSION}-trunk release $VERSION
dch -r ''
git add debian/changelog
git commit -m "release $VERSION"
TAGNAME=$(echo $VERSION | sed -e 's/~/%7E/') # sigh
git tag $TAGNAME -m "release $VERSION"
git checkout --detach
git clean -fxd
git rm .gitignore
git rm -r debian
git rm release
echo $VERSION > VERSION
sed -e "s/@VERSION@/$VERSION/" README.in > README
git rm README.in
sed -i -e "s/__DEV__/$VERSION/" configure.ac
libtoolize -ic
autoreconf
rm -rf autom4te.cache
git add -A
#git commit -m "release $VERSION"
TREE=$(git write-tree)
COMMIT=$(echo release artifact for $VERSION | git commit-tree $TREE -p HEAD -p remotes/origin/release/artifact)
git tag release/$TAGNAME -m "release $VERSION processed for git archive" $COMMIT
git push origin $TAGNAME release/$TAGNAME $COMMIT:release/artifact
git reset --hard master
git checkout master