update vergen

This commit is contained in:
Tamo 2021-07-26 15:25:30 +02:00
parent b4c98f6cc3
commit f79b8287f5
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
5 changed files with 98 additions and 32 deletions

View file

@ -18,7 +18,7 @@ hex = { version = "0.4.3", optional = true }
reqwest = { version = "0.11.3", features = ["blocking", "rustls-tls"], default-features = false, optional = true }
sha-1 = { version = "0.9.4", optional = true }
tempfile = { version = "3.1.0", optional = true }
vergen = "3.1.0"
vergen = { version = "5.1.13", default-features = false, features = ["build", "git"] }
zip = { version = "0.5.12", optional = true }
[dependencies]

View file

@ -1,12 +1,7 @@
use vergen::{generate_cargo_keys, ConstantsFlags};
use vergen::{vergen, Config};
fn main() {
// Setup the flags, toggling off the 'SEMVER_FROM_CARGO_PKG' flag
let mut flags = ConstantsFlags::all();
flags.toggle(ConstantsFlags::SEMVER_FROM_CARGO_PKG);
// Generate the 'cargo:' key output
generate_cargo_keys(ConstantsFlags::all()).expect("Unable to generate the cargo keys!");
vergen(Config::default()).unwrap();
#[cfg(feature = "mini-dashboard")]
mini_dashboard::setup_mini_dashboard().expect("Could not load the mini-dashboard assets");

View file

@ -105,11 +105,11 @@ async fn run_http(data: Data, opt: Opt) -> Result<(), Box<dyn std::error::Error>
pub fn print_launch_resume(opt: &Opt, data: &Data) {
let commit_sha = match option_env!("COMMIT_SHA") {
Some("") | None => env!("VERGEN_SHA"),
Some("") | None => env!("VERGEN_GIT_SHA"),
Some(commit_sha) => commit_sha,
};
let commit_date = match option_env!("COMMIT_DATE") {
Some("") | None => env!("VERGEN_COMMIT_DATE"),
let commit_date = match dbg!(option_env!("COMMIT_DATE")) {
Some("") | None => dbg!(env!("VERGEN_GIT_COMMIT_TIMESTAMP")),
Some(commit_date) => commit_date,
};

View file

@ -246,11 +246,11 @@ struct VersionResponse {
async fn get_version(_data: GuardedData<Private, Data>) -> HttpResponse {
let commit_sha = match option_env!("COMMIT_SHA") {
Some("") | None => env!("VERGEN_SHA"),
Some("") | None => env!("VERGEN_GIT_SHA"),
Some(commit_sha) => commit_sha,
};
let commit_date = match option_env!("COMMIT_DATE") {
Some("") | None => env!("VERGEN_COMMIT_DATE"),
Some("") | None => env!("VERGEN_GIT_COMMIT_TIMESTAMP"),
Some(commit_date) => commit_date,
};