aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..eea4a15
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+set -e
+
+LICENSE="$(cat LICENSE)"
+
+version="$(git log --format="%h %d" -1)
+$(go version)
+Build Date: $(date +%m.%d.%Y)
+Source code can be found here:
+https://git.riedstra.dev/mitch/paste/about
+
+$LICENSE"
+
+if ! git diff-index --quiet HEAD ; then
+ version="dirty: $version"
+fi
+
+export CGO_ENABLED=0
+
+go build -ldflags="-X 'main.Version=$version'" -o paste .
+go build -ldflags="-X 'main.Version=$version'" -o paste-client ./client