[infra] Always produce a proper Dart version string on release channels

Previously, if --custom_for_pub was used we used the latest dev tag.
This "best effort" for Dart rolls from bleeding edge, but doesn't make
sense when rolling from other channels that have a proper version in the
VERSION file.

Change-Id: Icaf6c26858d9fd2132d26b7d64da21b3a05f0092
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105763
Reviewed-by: Siva Annamalai <asiva@google.com>
diff --git a/tools/make_version.py b/tools/make_version.py
index bf88617..05f72e8 100755
--- a/tools/make_version.py
+++ b/tools/make_version.py
@@ -41,7 +41,8 @@
 ]
 
 def MakeVersionString(quiet, no_git_hash, custom_for_pub=None):
-  if custom_for_pub:
+  channel = utils.GetChannel()
+  if custom_for_pub and channel == 'be':
     latest = utils.GetLatestDevTag()
     if not latest:
       # If grabbing the dev tag fails, then fall back on the VERSION file.
@@ -101,7 +102,8 @@
         action="store",
         type="string",
         help=("Generates a version string that works with pub that includes"
-              "the given string"))
+              "the given string. This is silently ignored on channels other"
+              "than be"))
     parser.add_option("--input",
         action="store",
         type="string",