Joey Perrott fc1b557d98 build: run pre-check before publishing (#36527)
Previously, our process included running the pre-check script before
releasing.  With our new publishing process this was dropped.  This
change adds in automatically executing this check before publish for
both next and latest

PR Close #36527
2020-04-22 17:07:49 -04:00

16 lines
666 B
Bash
Executable File

#!/usr/bin/env bash
# Runs the Bazel workspace status command in order to ensure that the version placeholder
# will be replaced with the proper version name when building the release output.
versionName=$(node tools/bazel_stamp_vars.js | grep -e "BUILD_SCM_VERSION" | cut -d " " -f2)
if [[ ! ${versionName} =~ ^[0-9]+\.[0-9]+\.[0-9]+(-(rc|next).[0-9]+)?$ ]]; then
echo "ERROR: The release will currently have the following version: ${versionName}"
echo "This does not match the version format for releases to NPM."
echo ""
echo "Please ensure that the most recent commit in the current branch is tagged"
echo "with the proper version tag."
exit 1
fi