Use version from git-describe to better identify builds
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Valentin Brandl 2023-04-14 00:39:47 +02:00
parent 119dcd4cff
commit 037e520beb
Signed by: vbrandl
GPG Key ID: CAD4DA1A789125F9
3 changed files with 7 additions and 3 deletions

View File

@ -3,7 +3,10 @@ use ructe::Ructe;
use vergen::EmitBuilder; use vergen::EmitBuilder;
fn main() -> Result<()> { 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 ructe = Ructe::from_env()?;
let mut statics = ructe.statics()?; let mut statics = ructe.statics()?;

View File

@ -5,7 +5,8 @@ pub struct VersionInfo<'a> {
pub(crate) const VERSION_INFO: VersionInfo = VersionInfo { pub(crate) const VERSION_INFO: VersionInfo = VersionInfo {
commit: env!("VERGEN_GIT_SHA"), commit: env!("VERGEN_GIT_SHA"),
version: env!("CARGO_PKG_VERSION"), version: env!("VERGEN_GIT_DESCRIBE"),
// version: env!("CARGO_PKG_VERSION"),
}; };
lazy_static! { lazy_static! {

View File

@ -35,7 +35,7 @@
<nav> <nav>
<ul> <ul>
<li> <li>
<small>HoC v@version_info.version - <a href="https://github.com/vbrandl/hoc/commit/@version_info.commit">@version_info.commit</a></small> <small>HoC @version_info.version - <a href="https://github.com/vbrandl/hoc/commit/@version_info.commit">@version_info.commit</a></small>
</li> </li>
</ul> </ul>
</nav> </nav>