mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-01 06:50:00 +00:00
Improved build script (#152)
- explicity disable cgo - ensure static builds - reduce binary size - small formatting changes Signed-off-by: kim (grufwub) <grufwub@gmail.com>
This commit is contained in:
parent
ddc120d5e6
commit
03479312f1
1 changed files with 6 additions and 3 deletions
9
build.sh
9
build.sh
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue