From 957040e5211c4bf962bcb0fcb57379c607af820d Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Wed, 23 Oct 2019 21:52:06 +1100 Subject: [PATCH] Add version tags to cross compile script --- scripts/cross-compile.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/cross-compile.sh b/scripts/cross-compile.sh index 2a1c8d863..6a1d6d45a 100755 --- a/scripts/cross-compile.sh +++ b/scripts/cross-compile.sh @@ -1,9 +1,13 @@ #!/bin/sh +DATE=`go run scripts/getDate.go` +GITHASH=`git rev-parse --short HEAD` +VERSION_FLAGS="-X 'github.com/stashapp/stash/pkg/api.buildstamp=$DATE' -X 'github.com/stashapp/stash/pkg/api.githash=$GITHASH'" + SETUP="export GO111MODULE=on; export CGO_ENABLED=1;" -WINDOWS="GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ packr2 build -o dist/stash-win.exe -ldflags \"-extldflags '-static'\" -tags extended -v -mod=vendor;" -DARWIN="GOOS=darwin GOARCH=amd64 CC=o64-clang CXX=o64-clang++ packr2 build -o dist/stash-osx -tags extended -v -mod=vendor;" -LINUX="packr2 build -o dist/stash-linux -v -mod=vendor;" +WINDOWS="GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ packr2 build -o dist/stash-win.exe -ldflags \"-extldflags '-static' $VERSION_FLAGS\" -tags extended -v -mod=vendor;" +DARWIN="GOOS=darwin GOARCH=amd64 CC=o64-clang CXX=o64-clang++ packr2 build -o dist/stash-osx -ldflags \"$VERSION_FLAGS\" -tags extended -v -mod=vendor;" +LINUX="packr2 build -o dist/stash-linux -ldflags \"$VERSION_FLAGS\" -v -mod=vendor;" COMMAND="$SETUP $WINDOWS $DARWIN $LINUX"