2 # On the stable channel, check whether we're trying to build artifacts with the
3 # same version number of a release that's already been published, and fail the
4 # build if that's the case.
6 # It's a mistake whenever that happens: the release process won't start if it
7 # detects a duplicate version number, and the artifacts would have to be
13 if [[ "$(cat src/ci/channel)" != "stable" ]]; then
14 echo "This script only works on the stable channel. Skipping the check."
18 version="$(cat src/version)"
19 url="https://static.rust-lang.org/dist/channel-rust-${version}.toml"
21 if curl --silent --fail "${url}" >/dev/null; then
22 echo "The version number ${version} matches an existing release."
24 echo "If you're trying to prepare a point release, remember to change the"
25 echo "version number in the src/version file."
28 echo "The version number ${version} does not match any released version!"