Skip to content

Commit

Permalink
feat(resources): update bump script to strip suffix-version if no cha…
Browse files Browse the repository at this point in the history
…nges found
  • Loading branch information
joshuef committed Apr 9, 2024
1 parent f682844 commit d3677ba
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions resources/scripts/bump_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,19 @@ done < <(cat bump_version_output | grep "^\*")

len=${#crates_bumped[@]}
if [[ $len -eq 0 ]]; then
echo "No changes detected. Exiting without bumping any versions."
exit 0
echo "No changes detected."
if [[ -z "$SUFFIX" ]]; then
echo "Removing any existing suffixes and exiting without bumping any versions."
for crate in $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | .name'); do
version=$(cargo metadata --no-deps --format-version 1 | jq -r --arg crate_name "$crate" '.packages[] | select(.name==$crate_name) | .version')
new_version=$(echo "$version" | sed -E 's/(-alpha\.[0-9]+|-beta\.[0-9]+)$//')
if [[ "$version" != "$new_version" ]]; then
echo "Removing suffix from $crate, setting version to $new_version"
cargo set-version -p $crate $new_version
crates_bumped+=("${crate}-v${new_version}")
fi
done
fi
fi

if [[ -n "$SUFFIX" ]]; then
Expand Down

0 comments on commit d3677ba

Please sign in to comment.