Skip to content

Commit

Permalink
Chore update publish action
Browse files Browse the repository at this point in the history
* Update publish action to check last release version from crates, so we are not releasing crates that is already at their latest release
  • Loading branch information
juhaku committed Mar 5, 2022
1 parent f5156b3 commit 63c566b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/actions/publish/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ echo "$token" | cargo login
while read -r module; do
echo "Publishing module $module..."

current_version=$(cargo read-manifest --manifest-path "$module"/Cargo.toml | jq -r '.version')
last_version=$(curl -sS https://crates.io/api/v1/crates/"$module"/versions | jq -r '.versions[0].num')
if [[ "$last_version" == "$current_version" ]]; then
echo "Module: $module, is already at it's latest release ($last_version), nothing to release"
continue
fi

max_retries=10
retry=0
while ! publish "$module" && [[ $retry -lt $max_retries ]]; do
Expand Down

0 comments on commit 63c566b

Please sign in to comment.