diff --git a/osdk/Cargo.toml b/osdk/Cargo.toml index 9e6598be..967d373e 100644 --- a/osdk/Cargo.toml +++ b/osdk/Cargo.toml @@ -10,17 +10,12 @@ repository = "https://github.com/asterinas/asterinas" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies.linux-bzimage-builder] -git = "https://github.com/asterinas/asterinas" -# Make sure it syncs with `crate::util::ASTER_GIT_REV` -rev = "c9b66bd" -# When publishing, the crate.io version is used, make sure -# the builder is published -# FIXME: The version is currently commented out as it is no longer in use. -# If this version is being used, -# please ensure to update `bump_version.sh` appropriately. -# `bump_version.sh will also update this version, -# however, the dependent crate may not share the same version as the whole project. -# version = "0.1.0" +# The path for local development +path = "../framework/libs/linux-bzimage/builder" +# The version specified here is used for publishing on crates.io. +# Please update this version when publishing the cargo-osdk crate +# if there have been any changes to the dependent crate. +version = "0.1.0" [dependencies] clap = { version = "4.4.17", features = ["cargo", "derive"] } diff --git a/tools/bump_version.sh b/tools/bump_version.sh index fa44b730..68a1cc79 100755 --- a/tools/bump_version.sh +++ b/tools/bump_version.sh @@ -2,13 +2,18 @@ # SPDX-License-Identifier: MPL-2.0 +set -e + # This script is used to update Asterinas version numbers in all relevant files in the repository. # Usage: ./tools/bump_version.sh -# Update Cargo style versions (`version = "{version}"`) in file $1 -update_cargo_versions() { +# Update the package version (`version = "{version}"`) in file $1 +update_package_version() { echo "Updating file $1" - sed -i "s/^version = \"[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\"$/version = \"${new_version}\"/g" $1 + # Package version is usually the first version in Cargo.toml, + # so only the first matched version is updated. + pattern="^version = \"[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\"$" + sed -i "0,/${pattern}/s/${pattern}/version = \"${new_version}\"/1" $1 } # Update Docker image versions (`asterinas/asterinas:{version}`) in file $1 @@ -31,9 +36,9 @@ else exit -1 fi -# Update Cargo.toml -update_cargo_versions ${CARGO_TOML_PATH} -update_cargo_versions ${OSDK_CARGO_TOML_PATH} +# Update the package version in Cargo.toml +update_package_version ${CARGO_TOML_PATH} +update_package_version ${OSDK_CARGO_TOML_PATH} # Automatically bump Cargo.lock file cargo update -p asterinas --precise $new_version