From c4f1af8baa0a39cb28d76e36d91d305d2ef77c7d Mon Sep 17 00:00:00 2001 From: Ronoaldo JLP Date: Wed, 25 Aug 2021 18:22:26 +0000 Subject: [PATCH] make-dist.sh: more quiet output, better changelog. Changelog includes a header now, so it displays nicer on Github releases. Output is now much less verbose. --- scripts/make-dist.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/make-dist.sh b/scripts/make-dist.sh index 014c26b..f4c08da 100755 --- a/scripts/make-dist.sh +++ b/scripts/make-dist.sh @@ -1,6 +1,6 @@ #!/bin/sh set -e -set -x +# set -x ARCHS="amd64 386" OSES="linux windows" @@ -15,23 +15,26 @@ for GOOS in $OSES; do for GOARCH in $ARCHS; do echo "Building for GOOS=$GOOS GOARCH=$GOARCH" GOOS=$GOOS GOARCH=$GOARCH go build -o dist/contentdb ./cmd/contentdb - zip dist/contentdb-$GOOS-$GOARCH.zip dist/contentdb README.md LICENSE + zip -q dist/contentdb-$GOOS-$GOARCH.zip dist/contentdb README.md LICENSE export FILES="$FILES dist/contentdb-$GOOS-$GOARCH.zip" rm -f dist/contentdb done done # Prepare a Github release -git tag --sort creatordate LAST=$(git tag --sort creatordate | tail -n 1) -read -p "Release version (latest is $LAST): " VERSION -CHANGES="$(mktemp)" -git log --pretty="* %an: %s" ${LAST}..HEAD > $CHANGES +read -p "New tag/version (latest is $LAST): " VERSION -echo "Releasing '$FILES' ..." +CHANGELOG="$(mktemp)" +echo "# Changelog" > $CHANGELOG +echo >> $CHANGELOG +git log --pretty="* %an: %s" ${LAST}..HEAD >> $CHANGELOG +cat $CHANGELOG +echo "Drafting a Github release (uploading $FILES) ..." gh release --repo ronoaldo/minetools create \ --draft \ - --notes-file $CHANGES \ + --title "minetools $VERSION" \ + --notes-file $CHANGELOG \ $VERSION \ $FILES \ No newline at end of file