Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839#!/usr/bin/env bash# Cuts a release: works out the next version from the conventional commits# since the last tag, lets `cargo release` stamp and tag it, and pushes the# tag. Run from a clean `main`, by a person. DEVELOPING.md has the setup.set -euo pipefailcd "$(dirname "$0")/.."
# git-cliff counts from the newest tag it can see. A shallow clone may not# reach that tag, and then it counts from the initial version instead and# prints a number that looks plausible.if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then echo "error: this clone is shallow; run \`git fetch --unshallow --tags\` first" >&2 exit 1fi
next="$(git cliff --unreleased --bumped-version | sed 's/^v//')"
# cliff.toml bumps the minor for a breaking change, which is only right below# 1.0. Once 1.0.0 ships, that flag has to become true, or the first breaking# change after it computes 1.1.0 and is tagged as compatible.major="${next%%.*}"breaking="$(sed -n 's/^breaking_always_bump_major *= *//p' cliff.toml)"if [ "$major" != "0" ] && [ "$breaking" != "true" ]; then cat >&2 <<'MSG'error: this release is 1.0.0 or later and cliff.toml still has breaking_always_bump_major = false, which is the 0.x rule.
Left as it is, the next `feat!` bumps the minor instead of the major and tags a version that claims compatibility it does not have.
Set it to true in cliff.toml, and update the comment above it to say the 0.x reasoning no longer applies, before cutting this release.MSG exit 1fi
cargo release "$next" --executegit push origin main --follow-tags