mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
build: Use separate version.txt
file to define crate version (#29136)
This commit is contained in:
parent
539e41b8d4
commit
4ded37a1e7
6 changed files with 18 additions and 12 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -2139,7 +2139,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deno_lib"
|
name = "deno_lib"
|
||||||
version = "2.3.1"
|
version = "0.20.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"capacity_builder",
|
"capacity_builder",
|
||||||
"deno_error",
|
"deno_error",
|
||||||
|
|
|
@ -110,7 +110,7 @@ denort_helper = { version = "0.2.0", path = "./ext/rt_helper" }
|
||||||
# workspace libraries
|
# workspace libraries
|
||||||
deno_bench_util = { version = "0.198.0", path = "./bench_util" }
|
deno_bench_util = { version = "0.198.0", path = "./bench_util" }
|
||||||
deno_features = { version = "0.1.0", path = "./runtime/features" }
|
deno_features = { version = "0.1.0", path = "./runtime/features" }
|
||||||
deno_lib = { version = "2.3.1", path = "./cli/lib" }
|
deno_lib = { version = "0.20.0", path = "./cli/lib" }
|
||||||
deno_npm_cache = { version = "0.23.0", path = "./resolvers/npm_cache" }
|
deno_npm_cache = { version = "0.23.0", path = "./resolvers/npm_cache" }
|
||||||
deno_permissions = { version = "0.63.0", path = "./runtime/permissions" }
|
deno_permissions = { version = "0.63.0", path = "./runtime/permissions" }
|
||||||
deno_resolver = { version = "0.35.0", path = "./resolvers/deno" }
|
deno_resolver = { version = "0.35.0", path = "./resolvers/deno" }
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "deno_lib"
|
name = "deno_lib"
|
||||||
version = "2.3.1"
|
version = "0.20.0"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
// Copyright 2018-2025 the Deno authors. MIT license.
|
// Copyright 2018-2025 the Deno authors. MIT license.
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
// todo(dsherret): remove this after Deno 242.0 is published and then
|
||||||
|
// align the version of this crate with Deno then. We need to wait because
|
||||||
|
// there was previously a deno_lib 2.4.0 published (https://crates.io/crates/deno_lib/versions)
|
||||||
|
let version_path = std::path::Path::new(".").join("version.txt");
|
||||||
|
println!("cargo:rerun-if-changed={}", version_path.display());
|
||||||
|
#[allow(clippy::disallowed_methods)]
|
||||||
|
let text = std::fs::read_to_string(version_path).unwrap();
|
||||||
|
println!("cargo:rustc-env=DENO_VERSION={}", text);
|
||||||
|
|
||||||
let commit_hash = git_commit_hash();
|
let commit_hash = git_commit_hash();
|
||||||
println!("cargo:rustc-env=GIT_COMMIT_HASH={}", commit_hash);
|
println!("cargo:rustc-env=GIT_COMMIT_HASH={}", commit_hash);
|
||||||
println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH");
|
println!("cargo:rerun-if-env-changed=GIT_COMMIT_HASH");
|
||||||
|
|
|
@ -15,7 +15,7 @@ pub fn otel_runtime_config() -> OtelRuntimeConfig {
|
||||||
|
|
||||||
const GIT_COMMIT_HASH: &str = env!("GIT_COMMIT_HASH");
|
const GIT_COMMIT_HASH: &str = env!("GIT_COMMIT_HASH");
|
||||||
const TYPESCRIPT: &str = "5.8.3";
|
const TYPESCRIPT: &str = "5.8.3";
|
||||||
pub const DENO_VERSION: &str = env!("CARGO_PKG_VERSION");
|
pub const DENO_VERSION: &str = env!("DENO_VERSION");
|
||||||
// TODO(bartlomieju): ideally we could remove this const.
|
// TODO(bartlomieju): ideally we could remove this const.
|
||||||
const IS_CANARY: bool = option_env!("DENO_CANARY").is_some();
|
const IS_CANARY: bool = option_env!("DENO_CANARY").is_some();
|
||||||
// TODO(bartlomieju): this is temporary, to allow Homebrew to cut RC releases as well
|
// TODO(bartlomieju): this is temporary, to allow Homebrew to cut RC releases as well
|
||||||
|
@ -40,13 +40,9 @@ pub static DENO_VERSION_INFO: std::sync::LazyLock<DenoVersionInfo> =
|
||||||
|
|
||||||
DenoVersionInfo {
|
DenoVersionInfo {
|
||||||
deno: if release_channel == ReleaseChannel::Canary {
|
deno: if release_channel == ReleaseChannel::Canary {
|
||||||
concat!(
|
concat!(env!("DENO_VERSION"), "+", env!("GIT_COMMIT_HASH_SHORT"))
|
||||||
env!("CARGO_PKG_VERSION"),
|
|
||||||
"+",
|
|
||||||
env!("GIT_COMMIT_HASH_SHORT")
|
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
env!("CARGO_PKG_VERSION")
|
env!("DENO_VERSION")
|
||||||
},
|
},
|
||||||
|
|
||||||
release_channel,
|
release_channel,
|
||||||
|
@ -57,12 +53,12 @@ pub static DENO_VERSION_INFO: std::sync::LazyLock<DenoVersionInfo> =
|
||||||
user_agent: if release_channel == ReleaseChannel::Canary {
|
user_agent: if release_channel == ReleaseChannel::Canary {
|
||||||
concat!(
|
concat!(
|
||||||
"Deno/",
|
"Deno/",
|
||||||
env!("CARGO_PKG_VERSION"),
|
env!("DENO_VERSION"),
|
||||||
"+",
|
"+",
|
||||||
env!("GIT_COMMIT_HASH_SHORT")
|
env!("GIT_COMMIT_HASH_SHORT")
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
concat!("Deno/", env!("CARGO_PKG_VERSION"))
|
concat!("Deno/", env!("DENO_VERSION"))
|
||||||
},
|
},
|
||||||
|
|
||||||
typescript: TYPESCRIPT,
|
typescript: TYPESCRIPT,
|
||||||
|
|
1
cli/lib/version.txt
Normal file
1
cli/lib/version.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
2.3.1
|
Loading…
Add table
Add a link
Reference in a new issue