Skip to content

Commit

Permalink
make-dist.sh: more quiet output, better changelog.
Browse files Browse the repository at this point in the history
Changelog includes a header now, so it displays nicer
on Github releases.

Output is now much less verbose.
  • Loading branch information
ronoaldo committed Aug 25, 2021
1 parent 0fb5629 commit c4f1af8
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions scripts/make-dist.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
set -e
set -x
# set -x

ARCHS="amd64 386"
OSES="linux windows"
Expand All @@ -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

0 comments on commit c4f1af8

Please sign in to comment.