diff --git a/VERSION b/VERSION index 8f0916f7..79a2734b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.0 +0.5.0 \ No newline at end of file diff --git a/osdk/src/commands/build/bin.rs b/osdk/src/commands/build/bin.rs index d960d806..4c969855 100644 --- a/osdk/src/commands/build/bin.rs +++ b/osdk/src/commands/build/bin.rs @@ -158,7 +158,7 @@ fn install_setup_with_arch( cmd.arg("--force"); cmd.arg("--root").arg(install_dir.as_ref()); cmd.arg("--git").arg(crate::util::ASTER_GIT_LINK); - cmd.arg("--rev").arg(crate::util::ASTER_GIT_REV); + cmd.arg("--tag").arg(crate::util::ASTER_GIT_TAG); cmd.arg("--target").arg(match arch { SetupInstallArch::X86_64 => "x86_64-unknown-none", SetupInstallArch::Other(path) => path.to_str().unwrap(), diff --git a/osdk/src/util.rs b/osdk/src/util.rs index 6c11c41a..c8249115 100644 --- a/osdk/src/util.rs +++ b/osdk/src/util.rs @@ -16,11 +16,13 @@ use quote::ToTokens; /// and use the published version in the generated Cargo.toml. pub const ASTER_GIT_LINK: &str = "https://github.com/asterinas/asterinas"; /// Make sure it syncs with the builder dependency in Cargo.toml. -pub const ASTER_GIT_REV: &str = "ccc4e6e"; +/// We cannot use `include_str!("../../VERSION")` here +/// because `cargo publish` does not allow using files outside of the crate directory. +pub const ASTER_GIT_TAG: &str = concat!("v", env!("CARGO_PKG_VERSION")); pub fn aster_crate_dep(crate_name: &str) -> String { format!( - "{} = {{ git = \"{}\", rev = \"{}\" }}", - crate_name, ASTER_GIT_LINK, ASTER_GIT_REV + "{} = {{ git = \"{}\", tag = \"{}\" }}", + crate_name, ASTER_GIT_LINK, ASTER_GIT_TAG ) } diff --git a/tools/bump_version.sh b/tools/bump_version.sh index 23c586bb..aad736a1 100755 --- a/tools/bump_version.sh +++ b/tools/bump_version.sh @@ -129,6 +129,7 @@ GET_STARTED_PATH=${ASTER_SRC_DIR}/docs/src/kernel/README.md update_image_versions $GET_STARTED_PATH # Create or update VERSION -echo "${new_version}" > ${VERSION_PATH} +# `-n` is used to avoid adding a '\n' in the VERSION file. +echo -n "${new_version}" > ${VERSION_PATH} echo "Bumped Asterinas & OSDK version to $new_version"