xca/release/git.release
Christian Hohnstaedt 957bdbaa72 Put release related files into an own sub-directory
git.release.something ->
   Create any git release with a tag to test package (debian/rpm) build

git.release -> Create required changes and tags for the next release
git.publish -> Finalize the release (github release)
gen-binary-hash / binary-hashes.json -> keep track of release hashes
2021-05-09 12:22:53 +02:00

78 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
set -e
type git || exit 1
test -s VERSION && test -s changelog && test -d ../qt
export TVERSION="$1"
commit=master
test -z "$2" || commit="$2"
if test -z "$TVERSION"; then
echo "usage: $0 <VERSION> [commit]"
echo " if commit is ommitted, 'master' is used"
exit 1
fi
if ! git diff-index --quiet HEAD --; then
echo "You have local changes, please commit, reset or stash them"
exit 1
fi
lasttag=$(git describe --abbrev=0 HEAD)
unset unchanged
for i in changelog README.md; do
if git diff --quiet "$lasttag" -- $i; then
echo "File $i untouched since $lasttag"
unchanged="x"
fi
done
if test -n "$unchanged"; then
echo "Are you sure to not change the file(s) above?"
read a
fi
x=$(git grep "^xca $TVERSION " changelog ||
git grep "^$TVERSION\$" VERSION || :)
if test -n "$x"; then
echo "$x"
echo Release $TVERSION already exists
exit 1
fi
echo "$TVERSION" > VERSION
(
LANG=C date +"xca $TVERSION %a %b %d %Y"
echo
cat changelog
) > changelog.new
mv changelog.new changelog
git commit VERSION changelog -m "Prepare XCA $TVERSION"
git tag -a "RELEASE.$TVERSION" -m "Release version $TVERSION"
# Create the tar.gz
make dist
releasedir="$HOME/xca-$TVERSION"
mkdir -p "$releasedir"
cp xca-$TVERSION.tar.gz "$releasedir"
(
cd ..
tar zxf "$releasedir/xca-$TVERSION.tar.gz"
mkdir -p "xca-$TVERSION/BUILD" && cd "xca-$TVERSION/BUILD"
../configure && make -j7
mkdir "$releasedir/doc"
cp -a doc/html "$releasedir/doc"
)
(
cd ..
rm -rf xca_build
"./xca-$TVERSION/release/build-w64.sh"
cp "xca-portable-${TVERSION}.zip" msi-installer-dir-${TVERSION}.zip "$releasedir"
)
ls -la "$releasedir"