Skip to content

Commit dffe364

Browse files
authored
chore: make fluvio version works when publishing (#4184)
1 parent 23eb0a9 commit dffe364

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

crates/fluvio/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../VERSION

crates/fluvio/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
fn main() {
22
// Copy VERSION file. Do not fail e.g. when built via `cargo publish`
3-
if let Ok(verpath) = std::fs::canonicalize("../../VERSION") {
3+
if let Ok(verpath) = std::fs::canonicalize("./VERSION") {
44
if verpath.exists() {
5-
println!("cargo:rerun-if-changed=../../VERSION");
5+
println!("cargo:rerun-if-changed=./VERSION");
66
}
77
}
88
println!("cargo:rerun-if-changed=build.rs");

crates/fluvio/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use tracing::instrument;
4646

4747
/// The minimum VERSION of the Fluvio Platform that this client is compatible with.
4848
const MINIMUM_PLATFORM_VERSION: &str = "0.9.0";
49-
pub(crate) const VERSION: &str = include_str!("../../../VERSION");
49+
pub(crate) const VERSION: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/VERSION"));
5050

5151
/// Creates a producer that sends records to the named topic
5252
///

0 commit comments

Comments
 (0)