@@ -40,10 +40,6 @@ with review. Specifically, prepare does the following:
4040* Creates the release branch if it doesn't exist locally. Release branches
4141 have names like "release-X.Y" where X and Y are the major and minor version
4242 numbers.
43- * Checks that RULES_GO_VERSION is set in go/def.bzl on the local release branch
44- for the minor version being released. RULES_GO_VERSION must be a sematic
45- version without the "v" prefix that Go uses, like "1.2.4". It must match
46- the -version flag, which does require the "v" prefix.
4743* Creates an archive zip file from the tip of the local release branch.
4844* Creates or updates a draft GitHub release with the given release notes.
4945 http_archive boilerplate is generated and appended to the release notes.
@@ -109,10 +105,9 @@ func runPrepare(ctx context.Context, stderr io.Writer, args []string) error {
109105 return fmt .Errorf ("release %s was already published" , version )
110106 }
111107
112- // Check that RULES_GO_VERSION is set correctly on the release branch.
113108 // If this is a minor release (x.y.0), create the release branch if it
114109 // does not exist.
115- fmt .Fprintf (stderr , "checking RULES_GO_VERSION ...\n " )
110+ fmt .Fprintf (stderr , "verifying release branch ...\n " )
116111 rootDir , err := repoRoot ()
117112 if err != nil {
118113 return err
@@ -125,19 +120,12 @@ func runPrepare(ctx context.Context, stderr io.Writer, args []string) error {
125120 branchName := "release-" + majorMinor [len ("v" ):]
126121 if ! gitBranchExists (ctx , rootDir , branchName ) {
127122 if ! isMinorRelease {
128- return fmt .Errorf ("release branch %q does not exist locally. Fetch it, set RULES_GO_VERSION, add commits, and run this command again." , branchName )
129- }
130- if err := checkRulesGoVersion (ctx , rootDir , "HEAD" , version ); err != nil {
131- return err
123+ return fmt .Errorf ("release branch %q does not exist locally. Fetch it, add commits, and run this command again." , branchName )
132124 }
133125 fmt .Fprintf (stderr , "creating branch %s...\n " , branchName )
134126 if err := gitCreateBranch (ctx , rootDir , branchName , "HEAD" ); err != nil {
135127 return err
136128 }
137- } else {
138- if err := checkRulesGoVersion (ctx , rootDir , branchName , version ); err != nil {
139- return err
140- }
141129 }
142130
143131 // Create an archive.
@@ -239,15 +227,3 @@ Release %s has been prepared and uploaded.
239227
240228 return nil
241229}
242-
243- func checkRulesGoVersion (ctx context.Context , dir , refName , version string ) error {
244- data , err := gitCatFile (ctx , dir , refName , "go/def.bzl" )
245- if err != nil {
246- return err
247- }
248- rulesGoVersionStr := []byte (fmt .Sprintf (`RULES_GO_VERSION = "%s"` , version [len ("v" ):]))
249- if ! bytes .Contains (data , rulesGoVersionStr ) {
250- return fmt .Errorf ("RULES_GO_VERSION was not set to %q in go/def.bzl. Set it, add commits, and run this command again." , version )
251- }
252- return nil
253- }
0 commit comments