From 4f3b3f5c0b00b8c47c7e7d8e6c2dda624e114cde Mon Sep 17 00:00:00 2001 From: Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 28 Jun 2021 12:17:20 +0200 Subject: 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. --- build.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 build.sh (limited to 'build.sh') 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 -- cgit v1.3