mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-10 05:46:48 +00:00
Specify the arguments for publishing the bzImage setup crate
This commit is contained in:
parent
688212899a
commit
9c10568a73
@ -41,15 +41,14 @@ while [ "$#" -gt 0 ]; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# Performs the publish check or publish the crate in directory $1, with
|
# Performs the publish check or publish the crate in directory $1.
|
||||||
# optional target $2. If the target is not specified, cargo will decide
|
# All the arguments after $1 are passed to `cargo publish`.
|
||||||
# the target automatically.
|
|
||||||
do_publish_for() {
|
do_publish_for() {
|
||||||
pushd $ASTER_SRC_DIR/$1
|
pushd $ASTER_SRC_DIR/$1
|
||||||
TARGET_ARGS=""
|
|
||||||
if [ -n "$2" ]; then
|
ADDITIONAL_ARGS="${@:2}"
|
||||||
TARGET_ARGS="--target $2"
|
RF="$RUSTFLAGS --check-cfg cfg(ktest)"
|
||||||
fi
|
|
||||||
if [ -n "$DRY_RUN" ]; then
|
if [ -n "$DRY_RUN" ]; then
|
||||||
# Temporarily change the crate version to the next patched version.
|
# Temporarily change the crate version to the next patched version.
|
||||||
#
|
#
|
||||||
@ -63,28 +62,35 @@ do_publish_for() {
|
|||||||
sed -i "0,/${pattern}/s/${pattern}/version = \"${next_patched_version}\"/1" Cargo.toml
|
sed -i "0,/${pattern}/s/${pattern}/version = \"${next_patched_version}\"/1" Cargo.toml
|
||||||
|
|
||||||
# Perform checks
|
# Perform checks
|
||||||
cargo publish --dry-run --allow-dirty $TARGET_ARGS
|
RUSTFLAGS=$RF cargo publish --dry-run --allow-dirty $ADDITIONAL_ARGS
|
||||||
cargo doc $TARGET_ARGS
|
RUSTFLAGS=$RF cargo doc $ADDITIONAL_ARGS
|
||||||
else
|
else
|
||||||
cargo publish --token $TOKEN $TARGET_ARGS
|
# Continue if the publish fails, as we may be re-triggering the
|
||||||
|
# workflow and the package may have already been published.
|
||||||
|
if ! RUSTFLAGS=$RF cargo publish --token $TOKEN $ADDITIONAL_ARGS; then
|
||||||
|
echo "Warning: Failed to publish $1"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
||||||
do_publish_for ostd/libs/linux-bzimage/boot-params
|
do_publish_for ostd/libs/linux-bzimage/boot-params
|
||||||
do_publish_for ostd/libs/linux-bzimage/builder
|
do_publish_for ostd/libs/linux-bzimage/builder
|
||||||
|
do_publish_for ostd/libs/linux-bzimage/setup \
|
||||||
|
--target ../builder/src/x86_64-i386_pm-none.json \
|
||||||
|
-Zbuild-std=core,alloc,compiler_builtins
|
||||||
do_publish_for osdk
|
do_publish_for osdk
|
||||||
|
|
||||||
# All supported targets of OSTD, this array should keep consistent with
|
# All supported targets of OSTD, this array should keep consistent with
|
||||||
# `package.metadata.docs.rs.targets` in `ostd/Cargo.toml`.
|
# `package.metadata.docs.rs.targets` in `ostd/Cargo.toml`.
|
||||||
TARGETS="x86_64-unknown-none"
|
TARGETS="x86_64-unknown-none"
|
||||||
for TARGET in $TARGETS; do
|
for TARGET in $TARGETS; do
|
||||||
do_publish_for ostd/libs/ostd-macros $TARGET
|
do_publish_for ostd/libs/ostd-macros --target $TARGET
|
||||||
do_publish_for ostd/libs/ostd-test $TARGET
|
do_publish_for ostd/libs/ostd-test --target $TARGET
|
||||||
do_publish_for ostd/libs/linux-bzimage/setup $TARGET
|
do_publish_for ostd --target $TARGET
|
||||||
do_publish_for ostd $TARGET
|
do_publish_for osdk/deps/frame-allocator --target $TARGET
|
||||||
do_publish_for osdk/deps/frame-allocator $TARGET
|
do_publish_for osdk/deps/test-kernel --target $TARGET
|
||||||
do_publish_for osdk/deps/test-kernel $TARGET
|
|
||||||
|
|
||||||
# For actual publishing, we should only publish once. Using any target that
|
# For actual publishing, we should only publish once. Using any target that
|
||||||
# OSTD supports is OK. Here we use the first target in the list.
|
# OSTD supports is OK. Here we use the first target in the list.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user