@@ -40,10 +40,6 @@ with review. Specifically, prepare does the following:
40
40
* Creates the release branch if it doesn't exist locally. Release branches
41
41
have names like "release-X.Y" where X and Y are the major and minor version
42
42
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.
47
43
* Creates an archive zip file from the tip of the local release branch.
48
44
* Creates or updates a draft GitHub release with the given release notes.
49
45
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 {
109
105
return fmt .Errorf ("release %s was already published" , version )
110
106
}
111
107
112
- // Check that RULES_GO_VERSION is set correctly on the release branch.
113
108
// If this is a minor release (x.y.0), create the release branch if it
114
109
// does not exist.
115
- fmt .Fprintf (stderr , "checking RULES_GO_VERSION ...\n " )
110
+ fmt .Fprintf (stderr , "verifying release branch ...\n " )
116
111
rootDir , err := repoRoot ()
117
112
if err != nil {
118
113
return err
@@ -125,19 +120,12 @@ func runPrepare(ctx context.Context, stderr io.Writer, args []string) error {
125
120
branchName := "release-" + majorMinor [len ("v" ):]
126
121
if ! gitBranchExists (ctx , rootDir , branchName ) {
127
122
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 )
132
124
}
133
125
fmt .Fprintf (stderr , "creating branch %s...\n " , branchName )
134
126
if err := gitCreateBranch (ctx , rootDir , branchName , "HEAD" ); err != nil {
135
127
return err
136
128
}
137
- } else {
138
- if err := checkRulesGoVersion (ctx , rootDir , branchName , version ); err != nil {
139
- return err
140
- }
141
129
}
142
130
143
131
// Create an archive.
@@ -239,15 +227,3 @@ Release %s has been prepared and uploaded.
239
227
240
228
return nil
241
229
}
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