1
1
mirror of https://github.com/walles/moar.git synced 2024-09-11 12:15:43 +03:00
moar/release.sh

46 lines
1.1 KiB
Bash
Raw Normal View History

2019-08-04 20:07:14 +03:00
#!/bin/bash
set -e -o pipefail
./test.sh
2019-08-04 20:40:58 +03:00
# 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
2019-08-04 20:07:14 +03:00
# 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
2019-08-04 20:45:20 +03:00
git tag --annotate "$VERSION"
2019-08-04 20:07:14 +03:00
# 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
2019-08-04 20:44:00 +03:00
echo "Please upload the following binaries to <https://github.com/walles/moar/releases/tag/$VERSION>:"
2019-08-04 20:07:14 +03:00
find . -maxdepth 1 -name 'moar-*-*-*' -print0 | xargs -0 -n1 basename