mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-08 04:55:03 +00:00
Avoid incrementing the crate version in publish ostd if the mode is try run
This commit is contained in:
parent
f0957d2f54
commit
55deb6a68b
@ -50,17 +50,6 @@ do_publish_for() {
|
|||||||
RF="$RUSTFLAGS --check-cfg cfg(ktest)"
|
RF="$RUSTFLAGS --check-cfg cfg(ktest)"
|
||||||
|
|
||||||
if [ -n "$DRY_RUN" ]; then
|
if [ -n "$DRY_RUN" ]; then
|
||||||
# Temporarily change the crate version to the next patched version.
|
|
||||||
#
|
|
||||||
# `cargo publish --dry-run` requires that
|
|
||||||
# the crate version is not already published on crates.io,
|
|
||||||
# otherwise, the check will fail.
|
|
||||||
# Therefore, we modify the crate version to ensure it is not published.
|
|
||||||
current_version=$(cat $ASTER_SRC_DIR/VERSION)
|
|
||||||
next_patched_version=$(echo "$current_version" | awk -F. '{printf "%d.%d.%d\n", $1, $2, $3 + 1}')
|
|
||||||
pattern="^version = \"[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\"$"
|
|
||||||
sed -i "0,/${pattern}/s/${pattern}/version = \"${next_patched_version}\"/1" Cargo.toml
|
|
||||||
|
|
||||||
# Perform checks
|
# Perform checks
|
||||||
RUSTFLAGS=$RF cargo publish --dry-run --allow-dirty $ADDITIONAL_ARGS
|
RUSTFLAGS=$RF cargo publish --dry-run --allow-dirty $ADDITIONAL_ARGS
|
||||||
RUSTFLAGS=$RF cargo doc $ADDITIONAL_ARGS
|
RUSTFLAGS=$RF cargo doc $ADDITIONAL_ARGS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user