diff options
| author | 2021-06-28 12:17:20 +0200 | |
|---|---|---|
| committer | 2021-06-28 12:17:20 +0200 | |
| commit | 4f3b3f5c0b00b8c47c7e7d8e6c2dda624e114cde (patch) | |
| tree | af7583b906543148fcd00c2e4e3bf0525f03be18 /build.sh | |
| parent | Remote instance dereferencing (#70) (diff) | |
| download | gotosocial-4f3b3f5c0b00b8c47c7e7d8e6c2dda624e114cde.tar.xz | |
put version in binary properly (#73)
Addresses #71 :
Set version on the CLI framework.
Add a build.sh script that injects variables into the build tooling using git and a version file.
Set version in config.
Diffstat (limited to 'build.sh')
| -rwxr-xr-x | build.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..18a927e2d --- /dev/null +++ b/build.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -eu + +export COMMIT=$(git rev-list -1 HEAD) +export VERSION=$(cat ./version) + +go build -ldflags="-X 'main.Commit=$COMMIT' -X 'main.Version=$VERSION'" ./cmd/gotosocial |
