Use version from git to indicate unreleased changes (#5470)

This commit is contained in:
Nutomic 2025-03-03 15:55:33 +00:00 committed by GitHub
parent 97772b9553
commit 62fb03599a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 1 deletions

21
Cargo.lock generated
View file

@ -1813,6 +1813,26 @@ version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
[[package]]
name = "git-version"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ad568aa3db0fcbc81f2f116137f263d7304f512a1209b35b85150d3ef88ad19"
dependencies = [
"git-version-macro",
]
[[package]]
name = "git-version-macro"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.96",
]
[[package]]
name = "glob"
version = "0.3.2"
@ -2854,6 +2874,7 @@ dependencies = [
"doku",
"enum-map",
"futures",
"git-version",
"html2text",
"http 1.2.0",
"itertools 0.14.0",

View file

@ -91,6 +91,7 @@ markdown-it-sup = "1.0.1"
markdown-it-ruby = "1.0.1"
markdown-it-footnote = "0.2.0"
moka = { workspace = true, optional = true }
git-version = "0.3.9"
[dev-dependencies]
pretty_assertions = { workspace = true }

View file

@ -13,11 +13,15 @@ cfg_if! {
}
pub mod error;
use git_version::git_version;
use std::time::Duration;
pub type ConnectionId = usize;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const VERSION: &str = git_version!(
args = ["--tags", "--dirty=-modified"],
fallback = env!("CARGO_PKG_VERSION")
);
pub const REQWEST_TIMEOUT: Duration = Duration::from_secs(10);