1
1
mirror of https://github.com/walles/moar.git synced 2024-08-16 23:40:35 +03:00
moar/release.sh
2019-08-04 19:45:20 +02:00

46 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e -o pipefail
./test.sh
# Bail if we're on a dirty version
if [ -n "$(git diff --stat)" ]; then
echo "ERROR: Please commit all changes before doing a release"
echo
git status
exit 1
fi
# List existing version numbers...
echo
git tag | cat
# ... and ask for a new version number.
echo
echo "Please provide a version number for the new release:"
read -r VERSION
# FIXME: When asking for a release description, list
# changes since last release as inspiration
# Make an annotated tag for this release
git tag --annotate "$VERSION"
# NOTE: To get the version number right, these builds must
# be done after the above tagging.
#
# NOTE: Make sure this list matches the one in test.sh
GOOS=linux GOARCH=386 ./build.sh
GOOS=darwin GOARCH=amd64 ./build.sh
# Push the newly built release tag
git push --tags
# FIXME: Instead of asking the user to upload the binaries,
# upload them for the user.
echo
echo "Please upload the following binaries to <https://github.com/walles/moar/releases/tag/$VERSION>:"
find . -maxdepth 1 -name 'moar-*-*-*' -print0 | xargs -0 -n1 basename