@@ -244,17 +244,16 @@ func RegisterReleaseWorkflows(ctx context.Context, h *DefinitionHolder, build *B
244244 return err
245245 }
246246 releases := []struct {
247- kinds []task.ReleaseKind
248- name string
247+ majors []int
249248 }{
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.
253252 }
254253 for _ , r := range releases {
255254 wd := wf .New ()
256255
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 ))
258257 targetDate := wf .Param (wd , targetDateParam )
259258 securityContent := wf .Param (wd , securityPreAnnParam )
260259 cves := wf .Param (wd , securityPreAnnCVEsParam )
@@ -263,7 +262,11 @@ func RegisterReleaseWorkflows(ctx context.Context, h *DefinitionHolder, build *B
263262 sentMail := wf .Task5 (wd , "mail-pre-announcement" , comm .PreAnnounceRelease , versions , targetDate , securityContent , cves , coordinators )
264263 wf .Output (wd , "Pre-announcement URL" , wf .Task1 (wd , "await-pre-announcement" , comm .AwaitAnnounceMail , sentMail ))
265264
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 )
267270 }
268271
269272 // 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
306309 return err
307310 }
308311 type release struct {
309- kind task.ReleaseKind
310312 major int
313+ kind task.ReleaseKind
311314 suffix string
312315 }
313316 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.
320323 }
321324 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" })
323326 }
324327 for _ , r := range releases {
325328 wd := wf .New ()
@@ -330,7 +333,7 @@ func registerProdReleaseWorkflows(ctx context.Context, h *DefinitionHolder, buil
330333
331334 securitySummary := wf .Const ("" )
332335 securityFixes := wf .Slice [string ]()
333- if r .kind == task .KindCurrentMinor || r . kind == task . KindPrevMinor {
336+ if r .kind == task .KindMinor {
334337 securitySummary = wf .Param (wd , securitySummaryParameter )
335338 securityFixes = wf .Param (wd , securityFixesParameter )
336339 }
@@ -351,7 +354,7 @@ func registerProdReleaseWorkflows(ctx context.Context, h *DefinitionHolder, buil
351354func registerBuildTestSignOnlyWorkflow (h * DefinitionHolder , version * task.VersionTasks , build * BuildReleaseTasks , major int , kind task.ReleaseKind ) {
352355 wd := wf .New ()
353356
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 ))
355358 branch := fmt .Sprintf ("release-branch.go1.%d" , major )
356359 if kind == task .KindBeta {
357360 branch = "master"
@@ -373,12 +376,12 @@ func createMinorReleaseWorkflow(build *BuildReleaseTasks, milestone *task.Milest
373376 wd := wf .New ()
374377
375378 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 )
378381
379382 securitySummary := wf .Param (wd , securitySummaryParameter )
380383 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 )
382385
383386 return wd , nil
384387}
@@ -420,7 +423,7 @@ func addSingleReleaseWorkflow(
420423 startingHead := wf .Task1 (wd , "Read starting branch head" , version .ReadBranchHead , branchVal )
421424
422425 // 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 )
424427 timestamp := wf .Task0 (wd , "Timestamp release" , now )
425428 versionFile := wf .Task3 (wd , "Generate VERSION file" , version .GenerateVersionFile , distpackVal , nextVersion , timestamp )
426429 wf .Output (wd , "VERSION file" , versionFile )
0 commit comments