storj/scripts/release.sh
Egon Elbre f06ce1ef01 release: remove binary stripping
We've had bizarre crashes for satellite and it's difficult to debug
stripped binaries. The only binary where stripping is useful, is uplink
cli. This change will increase uplink by 5MB.

Change-Id: I4d1dfd36452063c22e8471d99eec97f6de6167b8
2020-10-14 10:06:20 +03:00

35 lines
842 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
set -o pipefail
echo -n "Build timestamp: "
TIMESTAMP=$(date +%s)
echo $TIMESTAMP
echo -n "Git commit: "
if [[ "$(git diff --stat)" != '' ]] || [[ -n "$(git status -s)" ]]; then
COMMIT=$(git rev-parse HEAD)-dirty
RELEASE=false
else
COMMIT=$(git rev-parse HEAD)
RELEASE=true
fi
echo $COMMIT
echo -n "Tagged version: "
if git describe --tags --exact-match --match "v[0-9]*.[0-9]*.[0-9]*"; then
VERSION=$(git describe --tags --exact-match --match "v[0-9]*.[0-9]*.[0-9]*")
echo $VERSION
else
VERSION=v0.0.0
RELEASE=false
fi
echo Running "go $@"
exec go "$1" -ldflags \
"-X storj.io/private/version.buildTimestamp=$TIMESTAMP
-X storj.io/private/version.buildCommitHash=$COMMIT
-X storj.io/private/version.buildVersion=$VERSION
-X storj.io/private/version.buildRelease=$RELEASE" "${@:2}"