diff --git a/scripts/publish.sh b/scripts/publish.sh index 7c59cc11f8..cc309ab3c2 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -1,5 +1,4 @@ #!/bin/bash - VERSION=$(echo $1 | sed 's/v//') shift @@ -33,7 +32,7 @@ for PROJECT in "${PROJECTS[@]}" do PROJECT_PATH=$(echo "$PROJECT" | sed 's/gluon_//' | sed 's/gluon/./') - if ! (./scripts/sync_publish.sh "${PROJECT_PATH}" -f "$@"); then + if ! (cd "${PROJECT_PATH}" && retry cargo publish "$@"); then exit 1 fi done diff --git a/scripts/sync_publish.sh b/scripts/sync_publish.sh deleted file mode 100755 index aa8fbf90b2..0000000000 --- a/scripts/sync_publish.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# Usage: sync_publish /path/to/crate -f -# -# Publish a crate and wait for it to become available. -# -# https://gist.github.com/Riateche/a1c500fe760a2b9190beb0a7134db82d - -set -e -set -o pipefail - -TMP_DIR=/tmp/test1 - -DIR="$1" -FORCE="$2" - -NAME=$(grep '^name' "$DIR/Cargo.toml" | sed 's/name = "\([^"]*\)"/\1/') -cd "$DIR" - -VERSION=$(cargo metadata --format-version 1 2>/dev/null | jq -r '.packages[] | select(.name=="'$NAME'").version') - -rm -rf "$TMP_DIR" -cargo new "$TMP_DIR" > /dev/null 2>&1 -cd "$TMP_DIR" -cargo add "$NAME" --vers "=$VERSION" > /dev/null 2>&1 -if cargo generate-lockfile > /dev/null 2>&1; then - echo "$NAME=$VERSION already exists, skipping." - exit 0 -fi - -echo "Publishing $NAME=$VERSION" -if [ "$FORCE" != "-f" ]; then - echo "This is a dry run. Run with -f to publish." - exit 0 -fi - -cd "$DIR" -cargo publish - -cd "$TMP_DIR" -while ! cargo generate-lockfile > /dev/null 2>&1; do - echo "Waiting for crate to be published..." - sleep 1 -done