@@ -244,17 +244,16 @@ func RegisterReleaseWorkflows(ctx context.Context, h *DefinitionHolder, build *B
244
244
return err
245
245
}
246
246
releases := []struct {
247
- kinds []task.ReleaseKind
248
- name string
247
+ majors []int
249
248
}{
250
- {[]task. ReleaseKind { task . KindCurrentMinor , task . KindPrevMinor }, fmt . Sprintf ( "next minor release for Go 1.%d and 1.%d" , currentMajor , currentMajor - 1 )},
251
- {[]task. ReleaseKind { task . KindCurrentMinor }, fmt . Sprintf ( "next minor release for Go 1.%d" , currentMajor )},
252
- {[]task. ReleaseKind { task . KindPrevMinor }, fmt . Sprintf ( "next minor release for Go 1.%d" , currentMajor - 1 )},
249
+ {[]int { currentMajor , currentMajor - 1 }}, // Both minors.
250
+ {[]int { currentMajor }}, // Current minor only.
251
+ {[]int { currentMajor - 1 }}, // Previous minor only.
253
252
}
254
253
for _ , r := range releases {
255
254
wd := wf .New ()
256
255
257
- versions := wf .Task1 (wd , "Get next versions" , version .GetNextVersions , wf .Const (r .kinds ))
256
+ versions := wf .Task1 (wd , "Get next versions" , version .GetNextMinorVersions , wf .Const (r .majors ))
258
257
targetDate := wf .Param (wd , targetDateParam )
259
258
securityContent := wf .Param (wd , securityPreAnnParam )
260
259
cves := wf .Param (wd , securityPreAnnCVEsParam )
@@ -263,7 +262,11 @@ func RegisterReleaseWorkflows(ctx context.Context, h *DefinitionHolder, build *B
263
262
sentMail := wf .Task5 (wd , "mail-pre-announcement" , comm .PreAnnounceRelease , versions , targetDate , securityContent , cves , coordinators )
264
263
wf .Output (wd , "Pre-announcement URL" , wf .Task1 (wd , "await-pre-announcement" , comm .AwaitAnnounceMail , sentMail ))
265
264
266
- h .RegisterDefinition ("pre-announce " + r .name , wd )
265
+ var names []string
266
+ for _ , m := range r .majors {
267
+ names = append (names , fmt .Sprintf ("1.%d" , m ))
268
+ }
269
+ h .RegisterDefinition ("pre-announce next minor release for Go " + strings .Join (names , " and " ), wd )
267
270
}
268
271
269
272
// Register workflows for miscellaneous tasks that happen as part of the Go release cycle.
@@ -306,20 +309,20 @@ func registerProdReleaseWorkflows(ctx context.Context, h *DefinitionHolder, buil
306
309
return err
307
310
}
308
311
type release struct {
309
- kind task.ReleaseKind
310
312
major int
313
+ kind task.ReleaseKind
311
314
suffix string
312
315
}
313
316
releases := []release {
314
- {task . KindMajor , currentMajor + 1 , "final" },
315
- {task . KindRC , currentMajor + 1 , "next RC" },
316
- {task . KindBeta , currentMajor + 1 , "next beta" },
317
- {task .KindCurrentMinor , currentMajor , "next minor" },
318
- {task . KindPrevMinor , currentMajor - 1 , "next minor" },
319
- {task . KindPrevMinor , currentMajor - 2 , "next minor" }, // TODO(go.dev/issue/62076): Remove after Go 1.19.13 is out.
317
+ {currentMajor + 1 , task . KindMajor , "final" },
318
+ {currentMajor + 1 , task . KindRC , "next RC" },
319
+ {currentMajor + 1 , task . KindBeta , "next beta" },
320
+ {currentMajor , task .KindMinor , "next minor" }, // Current minor only.
321
+ {currentMajor - 1 , task . KindMinor , "next minor" }, // Previous minor only.
322
+ {currentMajor - 2 , task . KindMinor , "next minor" }, // TODO(go.dev/issue/62076): Remove after Go 1.19.13 is out.
320
323
}
321
324
if time .Since (majorReleaseTime ) < 7 * 24 * time .Hour {
322
- releases = append (releases , release {task .KindMajor , currentMajor , "final" })
325
+ releases = append (releases , release {currentMajor , task .KindMajor , "final" })
323
326
}
324
327
for _ , r := range releases {
325
328
wd := wf .New ()
@@ -330,7 +333,7 @@ func registerProdReleaseWorkflows(ctx context.Context, h *DefinitionHolder, buil
330
333
331
334
securitySummary := wf .Const ("" )
332
335
securityFixes := wf .Slice [string ]()
333
- if r .kind == task .KindCurrentMinor || r . kind == task . KindPrevMinor {
336
+ if r .kind == task .KindMinor {
334
337
securitySummary = wf .Param (wd , securitySummaryParameter )
335
338
securityFixes = wf .Param (wd , securityFixesParameter )
336
339
}
@@ -351,7 +354,7 @@ func registerProdReleaseWorkflows(ctx context.Context, h *DefinitionHolder, buil
351
354
func registerBuildTestSignOnlyWorkflow (h * DefinitionHolder , version * task.VersionTasks , build * BuildReleaseTasks , major int , kind task.ReleaseKind ) {
352
355
wd := wf .New ()
353
356
354
- nextVersion := wf .Task1 (wd , "Get next version" , version .GetNextVersion , wf .Const (kind ))
357
+ nextVersion := wf .Task2 (wd , "Get next version" , version .GetNextVersion , wf . Const ( major ) , wf .Const (kind ))
355
358
branch := fmt .Sprintf ("release-branch.go1.%d" , major )
356
359
if kind == task .KindBeta {
357
360
branch = "master"
@@ -373,12 +376,12 @@ func createMinorReleaseWorkflow(build *BuildReleaseTasks, milestone *task.Milest
373
376
wd := wf .New ()
374
377
375
378
coordinators := wf .Param (wd , releaseCoordinators )
376
- currPublished := addSingleReleaseWorkflow (build , milestone , version , wd .Sub (fmt .Sprintf ("Go 1.%d" , currentMajor )), currentMajor , task .KindCurrentMinor , coordinators )
377
- prevPublished := addSingleReleaseWorkflow (build , milestone , version , wd .Sub (fmt .Sprintf ("Go 1.%d" , prevMajor )), prevMajor , task .KindPrevMinor , coordinators )
379
+ currPublished := addSingleReleaseWorkflow (build , milestone , version , wd .Sub (fmt .Sprintf ("Go 1.%d" , currentMajor )), currentMajor , task .KindMinor , coordinators )
380
+ prevPublished := addSingleReleaseWorkflow (build , milestone , version , wd .Sub (fmt .Sprintf ("Go 1.%d" , prevMajor )), prevMajor , task .KindMinor , coordinators )
378
381
379
382
securitySummary := wf .Param (wd , securitySummaryParameter )
380
383
securityFixes := wf .Param (wd , securityFixesParameter )
381
- addCommTasks (wd , build , comm , task .KindCurrentMinor , wf .Slice (currPublished , prevPublished ), securitySummary , securityFixes , coordinators )
384
+ addCommTasks (wd , build , comm , task .KindMinor , wf .Slice (currPublished , prevPublished ), securitySummary , securityFixes , coordinators )
382
385
383
386
return wd , nil
384
387
}
@@ -420,7 +423,7 @@ func addSingleReleaseWorkflow(
420
423
startingHead := wf .Task1 (wd , "Read starting branch head" , version .ReadBranchHead , branchVal )
421
424
422
425
// Select version, check milestones.
423
- nextVersion := wf .Task1 (wd , "Get next version" , version .GetNextVersion , kindVal )
426
+ nextVersion := wf .Task2 (wd , "Get next version" , version .GetNextVersion , wf . Const ( major ) , kindVal )
424
427
timestamp := wf .Task0 (wd , "Timestamp release" , now )
425
428
versionFile := wf .Task3 (wd , "Generate VERSION file" , version .GenerateVersionFile , distpackVal , nextVersion , timestamp )
426
429
wf .Output (wd , "VERSION file" , versionFile )
0 commit comments