Avoid trying to republish crates already on crates.io
This commit is contained in:
parent
d7fdfb7e21
commit
b01990d480
|
@ -36,6 +36,13 @@ for Cargo_toml in $Cargo_tomls; do
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
crate_name=$(grep -m 1 '^name = ' "$Cargo_toml" | cut -f 3 -d ' ' | tr -d \")
|
||||||
|
|
||||||
|
if [[ $(is_crate_version_uploaded "$crate_name" "$expectedCrateVersion") = True ]] ; then
|
||||||
|
echo "${crate_name} version ${expectedCrateVersion} is already on crates.io"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
(
|
(
|
||||||
set -x
|
set -x
|
||||||
crate=$(dirname "$Cargo_toml")
|
crate=$(dirname "$Cargo_toml")
|
||||||
|
@ -45,13 +52,10 @@ for Cargo_toml in $Cargo_tomls; do
|
||||||
ci/docker-run.sh "$rust_stable_docker_image" bash -exc "cd $crate; $cargoCommand"
|
ci/docker-run.sh "$rust_stable_docker_image" bash -exc "cd $crate; $cargoCommand"
|
||||||
) || true # <-- Don't fail. We want to be able to retry the job in cases when a publish fails halfway due to network/cloud issues
|
) || true # <-- Don't fail. We want to be able to retry the job in cases when a publish fails halfway due to network/cloud issues
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
crate_name=$(grep -m 1 '^name = ' $Cargo_toml | cut -f 3 -d ' ' | tr -d \")
|
|
||||||
numRetries=30
|
numRetries=30
|
||||||
for ((i = 1 ; i <= numRetries ; i++)); do
|
for ((i = 1 ; i <= numRetries ; i++)); do
|
||||||
echo "Attempt ${i} of ${numRetries}"
|
echo "Attempt ${i} of ${numRetries}"
|
||||||
# shellcheck disable=SC2086
|
if [[ $(is_crate_version_uploaded "$crate_name" "$expectedCrateVersion") = True ]] ; then
|
||||||
if [[ $(is_crate_version_uploaded $crate_name $expectedCrateVersion) = True ]] ; then
|
|
||||||
echo "Found ${crate_name} version ${expectedCrateVersion} on crates.io"
|
echo "Found ${crate_name} version ${expectedCrateVersion} on crates.io"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue