summaryrefslogtreecommitdiff
path: root/scripts/build.sh
blob: dde199549250be82185e49b347ff45832e424fb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh

set -eu

# DEBUG returns whether DEBUG build is enabled.
DEBUG() { [ ! -z "${DEBUG-}" ]; }

CGO_ENABLED=0 go build -trimpath \
                       -tags "netgo osusergo static_build kvformat $(DEBUG && echo 'debugenv')" \
                       -ldflags="-s -w -extldflags '-static' -X 'main.Version=${VERSION:-$(git describe --tags --abbrev=0)}'" \
                       ./cmd/gotosocial