Stamp release builds from exported git metadata
This commit is contained in:
@@ -52,6 +52,22 @@ else
|
||||
release_dir="target/release"
|
||||
fi
|
||||
|
||||
if command -v git >/dev/null 2>&1 && git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
if [ -z "${DOSH_BUILD_GIT_HASH:-}" ]; then
|
||||
export DOSH_BUILD_GIT_HASH="$(git rev-parse --short=12 HEAD)"
|
||||
fi
|
||||
if [ -z "${DOSH_BUILD_COMMIT_DATE:-}" ]; then
|
||||
export DOSH_BUILD_COMMIT_DATE="$(git show -s --format=%cs HEAD)"
|
||||
fi
|
||||
if [ -z "${DOSH_BUILD_GIT_DIRTY+x}" ]; then
|
||||
if git diff --quiet --ignore-submodules --; then
|
||||
export DOSH_BUILD_GIT_DIRTY=0
|
||||
else
|
||||
export DOSH_BUILD_GIT_DIRTY=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$os" = "windows" ]; then
|
||||
if [ -n "$target" ]; then
|
||||
cargo build --release --target "$target" --bin dosh-client --bin dosh-bench
|
||||
|
||||
Reference in New Issue
Block a user