From fda6e99f3f9206c30fd29cee6c3fd85b256dd836 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Tue, 2 Jan 2024 11:32:19 -0600 Subject: [PATCH] Remove release.sh script in favor of `cargo release` command --- RELEASES.md | 4 +- scripts/release.sh | 107 --------------------------------------------- 2 files changed, 2 insertions(+), 109 deletions(-) delete mode 100755 scripts/release.sh diff --git a/RELEASES.md b/RELEASES.md index 2cd2c508f..191c8de56 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -37,8 +37,8 @@ Our release process is as follows: 9. Create a signed tag `git tag -s -a vX.Y.Z`. In the tag message, write the version and the link to the corresponding section of the changelog. Then push the tag to GitHub with `git push --tags`. - - The [release workflow][release.yml] will run the [`release.sh`] script in a - CI worker. + - The [release workflow][release.yml] will run the `cargo release --execute` + command in a CI worker. 10. If some crates have not been released, check the cause of the failure and act accordingly: 1. In case of intermittent problems with the registry, rerun the script diff --git a/scripts/release.sh b/scripts/release.sh deleted file mode 100755 index d95806fdc..000000000 --- a/scripts/release.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/bash - -# release.sh will hopefully allow us to publish all of the necessary crates in -# this repo in the right order. It is assumed that only one person will be -# releasing all crates at the same time. - -set -euo pipefail - -# A space-separated list of all the crates we want to publish, in the order in -# which they must be published. It's important to respect this order, since -# each subsequent crate depends on one or more of the preceding ones. -DEFAULT_CRATES=( - "ibc-primitives" - "ibc-core-host-types" - "ibc-core-router-types" - "ibc-core-commitment-types" - "ibc-core-client-types" - "ibc-core-connection-types" - "ibc-core-channel-types" - "ibc-core-handler-types" - "ibc-core-client-context" - "ibc-core-host" - "ibc-core-router" - "ibc-core-client" - "ibc-core-connection" - "ibc-core-channel" - "ibc-core-handler" - "ibc-core" - "ibc-client-tendermint-types" - "ibc-client-tendermint" - "ibc-clients" - "ibc-app-transfer-types" - "ibc-app-transfer" - "ibc-apps" - "ibc-core-host-cosmos" - "ibc-data-types" - "ibc" - "ibc-query" - "ibc-testkit" -) - -# Allows us to override the crates we want to publish. -CRATES=("${@:-${DEFAULT_CRATES[@]}}") - -# Additional flags to pass to the "cargo publish" operation for every crate we -# publish. -CARGO_PUBLISH_FLAGS="" - -# Allow us to specify a crates.io API token via environment variables. Mostly -# for CI use. -if [ "$CRATES_TOKEN" != "" ]; then - CARGO_PUBLISH_FLAGS="${CARGO_PUBLISH_FLAGS} --token ${CRATES_TOKEN}" -fi - -get_manifest_path() { - cargo metadata --format-version 1 | jq -r '.packages[]|select(.name == "'"${1}"'")|.manifest_path' -} - -get_local_version() { - cargo metadata --format-version 1 | jq -r '.packages[]|select(.name == "'"${1}"'")|.version' -} - -check_version_online() { - curl -s "https://crates.io/api/v1/crates/${1}" | jq -r 'try .versions[]|select(.num == "'"${2}"'").updated_at' -} - -publish() { - echo "Publishing crate $1..." - cargo publish --manifest-path "$(get_manifest_path "${1}")" "$CARGO_PUBLISH_FLAGS" - echo "" -} - -wait_until_available() { - echo "Waiting for crate ${1} to become available via crates.io..." - for retry in {1..5}; do - sleep 5 - ONLINE_DATE="$(check_version_online "${1}" "${2}")" - if [ "$ONLINE_DATE" != "" ]; then - echo "Crate ${crate} is now available online" - break - else - if [ "$retry" == 5 ]; then - echo "ERROR: Crate should have become available by now" - exit 1 - else - echo "Not available just yet. Waiting a few seconds..." - fi - fi - done - echo "Waiting an additional 10 seconds for crate to propagate through CDN..." - sleep 10 -} - -echo "Attempting to publish crate(s): ${CRATES}" - -for crate in "$CRATES"; do - VERSION="$(get_local_version "$crate")" - ONLINE_DATE="$(check_version_online "$crate" "$VERSION")" - echo "${crate} version number: ${VERSION}" - if [ "$ONLINE_DATE" != "" ]; then - echo "${crate} ${VERSION} has already been published at ${ONLINE_DATE}, skipping" - continue - fi - - publish "$crate" - wait_until_available "$crate" "$VERSION" -done