2010-06-13 09:51:52 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-04-24 16:45:25 +00:00
|
|
|
# Usage: ./make_release.sh
|
2015-04-26 08:47:53 +00:00
|
|
|
# Creates a tar.gz archive of the current tree.
|
2015-04-24 16:45:25 +00:00
|
|
|
#
|
|
|
|
# To bump the version number for the current commit (make sure you are in HEAD!), run manually:
|
|
|
|
#
|
|
|
|
# git tag -a v0.12 -m 'Version 0.12'
|
|
|
|
#
|
|
|
|
# To generate a release for an older tagged commit, first list the tags with:
|
|
|
|
#
|
2015-04-26 08:47:53 +00:00
|
|
|
# git tag
|
2015-04-24 16:45:25 +00:00
|
|
|
#
|
|
|
|
# then checkout the tagged commit with:
|
|
|
|
#
|
|
|
|
# git checkout tags/v0.1
|
|
|
|
#
|
|
|
|
# Finally, to revert to HEAD:
|
|
|
|
#
|
|
|
|
# git checkout master
|
2015-04-26 08:47:53 +00:00
|
|
|
#
|
|
|
|
# See more at https://gitlab.com/o9000/tint2/wikis/Development
|
2010-06-13 09:51:52 +00:00
|
|
|
|
2015-04-24 22:07:25 +00:00
|
|
|
VERSION=$(./get_version.sh --strict)
|
2015-04-24 17:40:38 +00:00
|
|
|
if [ ! $? -eq 0 ]
|
|
|
|
then
|
|
|
|
echo >&2 "Error: get_version.sh failed!"
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-06-13 09:51:52 +00:00
|
|
|
|
2015-04-24 16:45:25 +00:00
|
|
|
DIR=tint2-$VERSION
|
2015-04-26 08:47:53 +00:00
|
|
|
ARCHIVE=$DIR.tar.gz
|
2015-04-24 16:45:25 +00:00
|
|
|
echo "Making release $DIR"
|
2015-04-26 08:47:53 +00:00
|
|
|
rm -rf $DIR $ARCHIVE
|
2010-06-13 09:51:52 +00:00
|
|
|
|
2015-04-24 16:45:25 +00:00
|
|
|
git checkout-index --prefix=$DIR/ -a
|
2010-06-13 09:51:52 +00:00
|
|
|
|
2015-04-24 16:45:25 +00:00
|
|
|
# Delete unneeded files
|
|
|
|
rm -f $DIR/make_release.sh
|
2010-06-13 09:51:52 +00:00
|
|
|
|
2015-04-24 16:45:25 +00:00
|
|
|
echo "echo \"#define VERSION_STRING \\\"$VERSION\\\"\" > version.h" > $DIR/get_version.sh
|
|
|
|
|
|
|
|
# Create tarball and remove the exported directory
|
2015-04-26 08:47:53 +00:00
|
|
|
tar -czf $ARCHIVE $DIR
|
2015-04-24 16:45:25 +00:00
|
|
|
rm -rf $DIR
|
|
|
|
|
2015-04-26 08:47:53 +00:00
|
|
|
sha1sum -b $ARCHIVE
|
|
|
|
sha256sum -b $ARCHIVE
|