aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-09-02 16:18:08 +0100
committerGitHub <noreply@github.com>2020-09-02 16:18:08 +0100
commit3b0774805cd06e1d9094a5b0773126cbfb573abb (patch)
treea3eb2fdaa28c8f88ace5294743910eddac74964f /build.sh
parent096191ca240776031370e99b93732557972ba92a (diff)
Version imprint (#1383)
* Versions * Update build.sh
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 087f4ae7..34e4b115 100755
--- a/build.sh
+++ b/build.sh
@@ -3,6 +3,11 @@
# Put installed packages into ./bin
export GOBIN=$PWD/`dirname $0`/bin
-go install -v $PWD/`dirname $0`/cmd/...
+export BRANCH=`(git symbolic-ref --short HEAD | cut -d'/' -f 3 )|| ""`
+export BUILD=`git rev-parse --short HEAD || ""`
-GOOS=js GOARCH=wasm go build -o main.wasm ./cmd/dendritejs
+export FLAGS="-X github.com/matrix-org/dendrite/internal.branch=$BRANCH -X github.com/matrix-org/dendrite/internal.build=$BUILD"
+
+go install -trimpath -ldflags "$FLAGS" -v $PWD/`dirname $0`/cmd/...
+
+GOOS=js GOARCH=wasm go build -trimpath -ldflags "$FLAGS" -o main.wasm ./cmd/dendritejs