mirror of
https://github.com/walles/moar.git
synced 2024-08-16 23:40:35 +03:00
Add a script for making new releases
This commit is contained in:
parent
eab564a705
commit
bc4bae3625
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
/moar
|
||||
/moar-*-*-*
|
||||
|
@ -84,7 +84,7 @@ Install (into `/usr/local/bin`) from source:
|
||||
Making a new Release
|
||||
--------------------
|
||||
|
||||
FIXME: Go release instructions
|
||||
Execute `release.sh` and follow instructions.
|
||||
|
||||
TODO
|
||||
----
|
||||
|
7
build.sh
7
build.sh
@ -2,9 +2,14 @@
|
||||
|
||||
VERSION="$(git describe --tags --dirty)"
|
||||
|
||||
BINARY="moar"
|
||||
if [ -n "$GOOS$GOARCH" ] ; then
|
||||
BINARY="$BINARY-$VERSION-$GOOS-$GOARCH"
|
||||
fi
|
||||
|
||||
# Linker flags trick below from here:
|
||||
# https://www.reddit.com/r/golang/comments/4cpi2y/question_where_to_keep_the_version_number_of_a_go/d1kbap7?utm_source=share&utm_medium=web2x
|
||||
|
||||
# This line must be last in the script so that its return code
|
||||
# propagates properly to its caller
|
||||
go build -ldflags="-X main.versionString=$VERSION"
|
||||
go build -ldflags="-X main.versionString=$VERSION" -o "$BINARY"
|
||||
|
40
release.sh
Executable file
40
release.sh
Executable file
@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
./test.sh
|
||||
|
||||
# FIXME: Bail if we're on a dirty version
|
||||
|
||||
# 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 --annotated "$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: Put the actual URL here, don't just refer to Github
|
||||
#
|
||||
# FIXME: Instead of asking the user to upload the binaries,
|
||||
# upload them for the user.
|
||||
echo
|
||||
echo "Please upload the following binaries to the new release page on Github:"
|
||||
find . -maxdepth 1 -name 'moar-*-*-*' -print0 | xargs -0 -n1 basename
|
Loading…
Reference in New Issue
Block a user