Skip to content

Commit

Permalink
fix: update publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
nacardin committed Jul 16, 2024
1 parent 84b0759 commit 504fd22
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions scripts/publish-crates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,25 @@ function check_if_crate_uploaded() {
fi
}


# We're relying on CARGO_REGISTRY_TOKEN to be set in CI
function cargo_publish() {
cargo publish 2>&1 | tee "$CARGO_OUTPUT_TMP"

return "${PIPESTATUS[0]}"

}

function cargo_publish_all() {
# We want to loop though each of the crates and attempt to publish.

if [[ $ATTEMPTS -lt $((MAX_ATTEMPTS + 1)) ]];
then
for crate in "${PUBLISH_CRATES[@]}" ; do
echo "$crate";
pushd crates/"$crate";

# Save the `cargo publish` in case we get a non-zero exit
cargo_publish;
cargo publish -p $crate 2>&1 | tee "$CARGO_OUTPUT_TMP"
result="$?";

#echo "PUBLISH STEP HERE"
#(exit 101)

# cargo publish exit codes:
if [[ "$result" != 0 ]];
then
check_if_crate_uploaded "$crate";
else
CRATES_UPLOADED=$((CRATES_UPLOADED+1));
fi

popd
done
else
echo "❌ Max number of publish attempts reached"
Expand Down

0 comments on commit 504fd22

Please sign in to comment.