From c1c3c43c46139dc805e35efca78afdebe01dc1d7 Mon Sep 17 00:00:00 2001 From: Christian Hohnstaedt Date: Tue, 8 May 2018 22:55:53 +0200 Subject: [PATCH] Improve release and publish scripts --- git.publish | 5 +++-- git.release | 25 +++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/git.publish b/git.publish index f6ed8bf1..805d8449 100755 --- a/git.publish +++ b/git.publish @@ -12,14 +12,15 @@ releasedir="$HOME/xca-$TVERSION" ./misc/gen-binary-hash "$releasedir" echo "$TVERSION""+" > VERSION -git commit -a -m "Release $TVERSION done" +git commit -a -m "Release XCA $TVERSION done" -./github.release.py "$TVERSION" "${releasedir}/"*"xca-$TVERSION".* +./github.release.py "$TVERSION" "${releasedir}/"*"xca-$TVERSION"* cat << EOF After verifying the commits, tags and github release, finally do: git push origin --tags master + scp ${releasedir}/doc/* hohnstaedt.de:xca-doc/ Un-draft the release on github EOF diff --git a/git.release b/git.release index 8fca5871..1433a53f 100755 --- a/git.release +++ b/git.release @@ -20,9 +20,30 @@ if ! git diff-index --quiet HEAD --; then exit 1 fi -! git grep -q "^xca $TVERSION " changelog -! git grep -q "$TVERSION" VERSION +lasttag=$(git describe --abbrev=0 HEAD) +unset unchanged +for i in changelog doc/xca.sgml 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 $TVERSIO already exists + exit 1 +fi + +exit 0 echo "$TVERSION" > VERSION ( LANG=C date +"xca $TVERSION %a %b %d %Y"