diff options
author | 2021-08-26 11:19:52 +0100 | |
---|---|---|
committer | 2021-08-26 12:19:52 +0200 | |
commit | 03479312f1772f52ffc758b6997317112a6b1d3c (patch) | |
tree | a29a6b3a153cc7851c8e739bbc81f9dac72223ea | |
parent | fix public timeline bug (#150) (diff) | |
download | gotosocial-03479312f1772f52ffc758b6997317112a6b1d3c.tar.xz |
Improved build script (#152)
- explicity disable cgo
- ensure static builds
- reduce binary size
- small formatting changes
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
-rwxr-xr-x | build.sh | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -2,7 +2,10 @@ set -eu -export COMMIT=$(git rev-list -1 HEAD) -export VERSION=$(cat ./version) +COMMIT=$(git rev-list -1 HEAD) +VERSION=$(cat ./version) -go build -ldflags="-X 'main.Commit=$COMMIT' -X 'main.Version=$VERSION'" ./cmd/gotosocial +CGO_ENABLED=0 go build -trimpath \ + -tags 'netgo osusergo static_build' \ + -ldflags="-s -w -extldflags '-static' -X 'main.Commit=${COMMIT}' -X 'main.Version=${VERSION}'" \ + ./cmd/gotosocial |