all: add builder for release branch

Change-Id: If6d959b6677e9c52f2cebab0abcc1bbeb4fd150e
Reviewed-on: https://go-review.googlesource.com/c/build/+/464300
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Carlos Amedee <carlos@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
diff --git a/generated/cr-buildbucket.cfg b/generated/cr-buildbucket.cfg
index ec870a8..4c393e3 100644
--- a/generated/cr-buildbucket.cfg
+++ b/generated/cr-buildbucket.cfg
@@ -26,7 +26,23 @@
       }
     }
     builders {
-      name: "linux-amd64"
+      name: "linux-amd64-go1.20"
+      swarming_host: "chromium-swarm.appspot.com"
+      dimensions: "cpu:x86-64"
+      dimensions: "os:Linux"
+      exe {
+        cipd_package: "infra/experimental/golangbuild/${platform}"
+        cipd_version: "latest"
+        cmd: "golangbuild"
+      }
+      properties:
+        '{'
+        '  "project": "go"'
+        '}'
+      service_account: "luci-task@golang-ci-luci.iam.gserviceaccount.com"
+    }
+    builders {
+      name: "linux-amd64-master"
       swarming_host: "chromium-swarm.appspot.com"
       dimensions: "cpu:x86-64"
       dimensions: "os:Linux"
diff --git a/generated/luci-milo.cfg b/generated/luci-milo.cfg
index 0a85321..cfda3a5 100644
--- a/generated/luci-milo.cfg
+++ b/generated/luci-milo.cfg
@@ -19,7 +19,7 @@
   refs: "regexp:refs/heads/master"
   manifest_name: "REVISION"
   builders {
-    name: "buildbucket/luci.golang.ci/linux-amd64"
+    name: "buildbucket/luci.golang.ci/linux-amd64-master"
     category: "linux"
   }
 }
@@ -30,7 +30,7 @@
   refs: "regexp:refs/heads/release-branch.go1.20"
   manifest_name: "REVISION"
   builders {
-    name: "buildbucket/luci.golang.ci/linux-amd64"
+    name: "buildbucket/luci.golang.ci/linux-amd64-go1.20"
     category: "linux"
   }
 }
diff --git a/generated/luci-scheduler.cfg b/generated/luci-scheduler.cfg
index 2eaaa89..f9e0c24 100644
--- a/generated/luci-scheduler.cfg
+++ b/generated/luci-scheduler.cfg
@@ -15,12 +15,21 @@
   }
 }
 job {
-  id: "linux-amd64"
+  id: "linux-amd64-go1.20"
   realm: "ci"
   buildbucket {
     server: "cr-buildbucket.appspot.com"
     bucket: "ci"
-    builder: "linux-amd64"
+    builder: "linux-amd64-go1.20"
+  }
+}
+job {
+  id: "linux-amd64-master"
+  realm: "ci"
+  buildbucket {
+    server: "cr-buildbucket.appspot.com"
+    bucket: "ci"
+    builder: "linux-amd64-master"
   }
 }
 job {
@@ -44,7 +53,7 @@
 trigger {
   id: "go-master-trigger"
   realm: "ci"
-  triggers: "linux-amd64"
+  triggers: "linux-amd64-master"
   gitiles {
     repo: "https://go.googlesource.com/go"
     refs: "regexp:refs/heads/master"
@@ -53,7 +62,7 @@
 trigger {
   id: "go-release-1-20-trigger"
   realm: "ci"
-  triggers: "linux-amd64"
+  triggers: "linux-amd64-go1.20"
   gitiles {
     repo: "https://go.googlesource.com/go"
     refs: "regexp:refs/heads/release-branch.go1.20"
diff --git a/main.star b/main.star
index 5b55dc7..168fe82 100755
--- a/main.star
+++ b/main.star
@@ -117,7 +117,7 @@
     refs = ["refs/heads/master"],
     entries = [
         luci.console_view_entry(
-            builder = "linux-amd64",
+            builder = "linux-amd64-master",
             category = "linux",
         ),
     ],
@@ -131,31 +131,39 @@
     refs = ["refs/heads/release-branch.go1.20"],
     entries = [
         luci.console_view_entry(
-            builder = "linux-amd64",
+            builder = "linux-amd64-go1.20",
             category = "linux",
         ),
     ],
 )
 
-# Basic linux/amd64 CI builder.
-luci.builder(
-    name = "linux-amd64",
-    bucket = "ci",
-    executable = luci.executable(
-        name = "golangbuild",
-        cipd_package = "infra/experimental/golangbuild/${platform}",
-        cipd_version = "latest",
-        cmd = ["golangbuild"],
-    ),
-    dimensions = {
-        "os": "Linux",
-        "cpu": "x86-64",
-    },
-    properties = {
-        "project": "go",
-    },
-    service_account = "luci-task@golang-ci-luci.iam.gserviceaccount.com",
-)
+def _define_linux_amd64_builder(go_branch):
+    """Defines a standard linux-amd64 builder
+
+    Args:
+      go_branch: string, name of the Go branch the builder will build.
+    """
+    luci.builder(
+        name = 'linux-amd64-%s' % (go_branch),
+        bucket = "ci",
+        executable = luci.executable(
+            name = "golangbuild",
+            cipd_package = "infra/experimental/golangbuild/${platform}",
+            cipd_version = "latest",
+            cmd = ["golangbuild"],
+        ),
+        dimensions = {
+            "os": "Linux",
+            "cpu": "x86-64",
+        },
+        properties = {
+            "project": "go",
+        },
+        service_account = "luci-task@golang-ci-luci.iam.gserviceaccount.com",
+    )
+
+_define_linux_amd64_builder("master")
+_define_linux_amd64_builder("go1.20")
 
 # Poller for the 'master' branch for the main Go repository.
 luci.gitiles_poller(
@@ -163,7 +171,7 @@
     bucket = "ci",
     repo = "https://go.googlesource.com/go",
     refs = ["refs/heads/master"],
-    triggers = ["linux-amd64"],
+    triggers = ["linux-amd64-master"],
 )
 
 # Poller for the 'release-branch.go1.20' branch for the main Go repository.
@@ -172,7 +180,7 @@
     bucket = "ci",
     repo = "https://go.googlesource.com/go",
     refs = ["refs/heads/release-branch.go1.20"],
-    triggers = ["linux-amd64"],
+    triggers = ["linux-amd64-go1.20"],
 )
 
 exec("./recipes.star")