From 037e520beb9e2ca182585d3cd0711d9d33b9a505 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 14 Apr 2023 00:39:47 +0200 Subject: [PATCH] Use version from git-describe to better identify builds --- src/build.rs | 5 ++++- src/statics.rs | 3 ++- templates/base.rs.html | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/build.rs b/src/build.rs index 5490f9c..953557a 100644 --- a/src/build.rs +++ b/src/build.rs @@ -3,7 +3,10 @@ use ructe::Ructe; use vergen::EmitBuilder; fn main() -> Result<()> { - EmitBuilder::builder().git_sha(true).emit()?; + EmitBuilder::builder() + .git_sha(true) + .git_describe(true, true, None) + .emit()?; let mut ructe = Ructe::from_env()?; let mut statics = ructe.statics()?; diff --git a/src/statics.rs b/src/statics.rs index 3e799f2..8469ad1 100644 --- a/src/statics.rs +++ b/src/statics.rs @@ -5,7 +5,8 @@ pub struct VersionInfo<'a> { pub(crate) const VERSION_INFO: VersionInfo = VersionInfo { commit: env!("VERGEN_GIT_SHA"), - version: env!("CARGO_PKG_VERSION"), + version: env!("VERGEN_GIT_DESCRIBE"), + // version: env!("CARGO_PKG_VERSION"), }; lazy_static! { diff --git a/templates/base.rs.html b/templates/base.rs.html index da9a3cf..b895835 100644 --- a/templates/base.rs.html +++ b/templates/base.rs.html @@ -35,7 +35,7 @@