Bump only package version in Cargo.toml
This commit is contained in:
		
							parent
							
								
									2ecca7af6b
								
							
						
					
					
						commit
						6c34db52b3
					
				|  | @ -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"] } | ||||
|  |  | |||
|  | @ -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 <new_version> | ||||
| 
 | ||||
| # 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 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue