forked from zincsearch/zincsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·19 lines (12 loc) · 888 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
rm zincsearch
cd web
npm run build
cd ..
export VERSION=`git describe --tags --always`
export BUILD_DATE=`date -u '+%Y-%m-%d_%I:%M:%S%p-GMT'`
export COMMIT_HASH=`git rev-parse HEAD`
export ZINC_LDFLAGS="-w -s -X github.com/zincsearch/zincsearch/pkg/meta.Version=${VERSION} -X github.com/zincsearch/zincsearch/pkg/meta.BuildDate=${BUILD_DATE} -X github.com/zincsearch/zincsearch/pkg/meta.CommitHash=${COMMIT_HASH}"
# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s -X main.Version=$VERSION -X main.Date=$DATE -X main.Commit=$COMMIT_HASH" -o zincsearch cmd/zincsearch/main.go
# CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-X main.Version=$VERSION -X main.Date=$DATE -X main.Commit=$COMMIT_HASH" -o zincsearch cmd/zincsearch/main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="$ZINC_LDFLAGS" -o zincsearch cmd/zincsearch/main.go