ci: move to non-Docker version of goreleaser

This was the only option at the time this workflow was created, but now
it can work as a native, cross-platform action.

Also address a goreleaser deprecation:

    https://goreleaser.com/deprecations/#brewsgithub

Tested locally run using the version of goreleaser we are pinned to via:

    goreleaser --snapshot --skip-publish --rm-dist

from the repo root.

Fixes #737

Change-Id: If8a91d375e3a5046d3ce18577a9f1ed135287572
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8666
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 01f7594..30d0c5d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -14,14 +14,21 @@
     steps:
     - name: Checkout code
       uses: actions/checkout@v2
-    - name: Unshallow
-      run: git fetch --prune --unshallow
+      with:
+        fetch-depth: 0
+    - name: Install Go
+      uses: actions/setup-go@v2
+      with:
+        go-version: ${{ matrix.go-version }}
+        version: 1.15.8
+        stable: false
     - name: Run GoReleaser
-      env:
-        GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
-      uses: docker://goreleaser/goreleaser:v0.110.0
+      uses: goreleaser/goreleaser-action@v2
       with:
         args: release --rm-dist
+        version: v0.155.1
+      env:
+        GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
   docker:
     name: docker
     runs-on: ubuntu-18.04
@@ -29,7 +36,7 @@
       run:
         shell: bash
     steps:
-    - name: Check out the repo
+    - name: Checkout code
       uses: actions/checkout@v2
     - name: Set version environment
       run: |-
@@ -37,10 +44,6 @@
         echo "CUE_VERSION=$CUE_VERSION"
         echo "CUE_VERSION=$(echo $CUE_VERSION)" >> $GITHUB_ENV
     - name: Push to Docker Hub
-      env:
-        DOCKER_BUILDKIT: 1
-        GOLANG_VERSION: 1.14
-        CUE_VERSION: ${{ env.CUE_VERSION }}
       uses: docker/build-push-action@v1
       with:
         tags: ${{ env.CUE_VERSION }},latest
@@ -54,3 +57,7 @@
         build_args: GOLANG_VERSION=${{ env.GOLANG_VERSION }},CUE_VERSION=v${{ env.CUE_VERSION
           }}
         add_git_labels: true
+      env:
+        DOCKER_BUILDKIT: 1
+        GOLANG_VERSION: 1.14
+        CUE_VERSION: ${{ env.CUE_VERSION }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index fc5fc9e..9db04ad 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -30,7 +30,7 @@
       matrix:
         go-version:
         - 1.14.14
-        - 1.15.x
+        - 1.15.8
         - 1.16.0-rc1
         os:
         - ubuntu-18.04
@@ -63,7 +63,7 @@
     - name: Test
       run: go test ./...
     - if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/')
-        && matrix.go-version == '1.15.x' && matrix.os == 'ubuntu-18.04' }}
+        && matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }}
       name: Test with -race
       run: go test -race ./...
     - name: gorelease check
diff --git a/.gitignore b/.gitignore
index 8fa3368..004cbb9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 # Add no patterns to .gitignore except for files generated by the build.
 cmd/cue/cue
 **/*.test
+/dist
diff --git a/.goreleaser.yml b/.goreleaser.yml
index 9b90e3a..640f395 100644
--- a/.goreleaser.yml
+++ b/.goreleaser.yml
@@ -57,7 +57,7 @@
     - '^test:'
 
 brews:
-- github:
+- tap:
     owner: cuelang
     name: homebrew-tap
   commit_author:
diff --git a/cmd/cue/cmd/testdata/script/cmd_github.txt b/cmd/cue/cmd/testdata/script/cmd_github.txt
index 68811dc..018f32f 100644
--- a/cmd/cue/cmd/testdata/script/cmd_github.txt
+++ b/cmd/cue/cmd/testdata/script/cmd_github.txt
@@ -54,14 +54,21 @@
     steps:
     - name: Checkout code
       uses: actions/checkout@v2
-    - name: Unshallow
-      run: git fetch --prune --unshallow
+      with:
+        fetch-depth: 0
+    - name: Install Go
+      uses: actions/setup-go@v2
+      with:
+        go-version: ${{ matrix.go-version }}
+        version: 1.15.8
+        stable: false
     - name: Run GoReleaser
-      env:
-        GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
-      uses: docker://goreleaser/goreleaser:v0.110.0
+      uses: goreleaser/goreleaser-action@v2
       with:
         args: release --rm-dist
+        version: v0.155.1
+      env:
+        GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
   docker:
     name: docker
     runs-on: ubuntu-18.04
@@ -69,7 +76,7 @@
       run:
         shell: bash
     steps:
-    - name: Check out the repo
+    - name: Checkout code
       uses: actions/checkout@v2
     - name: Set version environment
       run: |-
@@ -77,10 +84,6 @@
         echo "CUE_VERSION=$CUE_VERSION"
         echo "CUE_VERSION=$(echo $CUE_VERSION)" >> $GITHUB_ENV
     - name: Push to Docker Hub
-      env:
-        DOCKER_BUILDKIT: 1
-        GOLANG_VERSION: 1.14
-        CUE_VERSION: ${{ env.CUE_VERSION }}
       uses: docker/build-push-action@v1
       with:
         tags: ${{ env.CUE_VERSION }},latest
@@ -94,6 +97,10 @@
         build_args: GOLANG_VERSION=${{ env.GOLANG_VERSION }},CUE_VERSION=v${{ env.CUE_VERSION
           }}
         add_git_labels: true
+      env:
+        DOCKER_BUILDKIT: 1
+        GOLANG_VERSION: 1.14
+        CUE_VERSION: ${{ env.CUE_VERSION }}
 -- .github/workflows/repository_dispatch.yml.golden --
 # Generated by internal/ci/ci_tool.cue; do not edit
 
@@ -198,7 +205,7 @@
       matrix:
         go-version:
         - 1.14.14
-        - 1.15.x
+        - 1.15.8
         - 1.16.0-rc1
         os:
         - ubuntu-18.04
@@ -231,7 +238,7 @@
     - name: Test
       run: go test ./...
     - if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/')
-        && matrix.go-version == '1.15.x' && matrix.os == 'ubuntu-18.04' }}
+        && matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }}
       name: Test with -race
       run: go test -race ./...
     - name: gorelease check
@@ -1306,33 +1313,31 @@
 	jobs: {
 		goreleaser: {
 			"runs-on": _#linuxMachine
-			steps: [{
-				name: "Checkout code"
-				uses: "actions/checkout@v2"
-			}, {
-				name: "Unshallow"
-				run:  "git fetch --prune --unshallow"
-			}, {
+			steps: [_#checkoutCode & {
+				with: "fetch-depth": 0
+			}, _#installGo & {
+				with: version: _#latestStableGo
+			}, _#step & {
 				name: "Run GoReleaser"
 				env: GITHUB_TOKEN: "${{ secrets.ACTIONS_GITHUB_TOKEN }}"
-				uses: "docker://goreleaser/goreleaser:v0.110.0"
-				with: args: "release --rm-dist"
+				uses: "goreleaser/goreleaser-action@v2"
+				with: {
+					args:    "release --rm-dist"
+					version: "v0.155.1"
+				}
 			}]
 		}
 		docker: {
 			name:      "docker"
 			"runs-on": _#linuxMachine
-			steps: [{
-				name: "Check out the repo"
-				uses: "actions/checkout@v2"
-			}, {
+			steps: [_#checkoutCode, _#step & {
 				name: "Set version environment"
 				run: """
 					CUE_VERSION=$(echo ${GITHUB_REF##refs/tags/v})
 					echo \"CUE_VERSION=$CUE_VERSION\"
 					echo \"CUE_VERSION=$(echo $CUE_VERSION)\" >> $GITHUB_ENV
 					"""
-			}, {
+			}, _#step & {
 				name: "Push to Docker Hub"
 				env: {
 					DOCKER_BUILDKIT: 1
@@ -1381,8 +1386,10 @@
 }).steps & [_])[0]
 
 // We need at least go1.14 for code generation
-_#codeGenGo:      "1.14.14"
-_#latestStableGo: "1.15.x"
+_#codeGenGo: "1.14.14"
+
+// Use a specific latest version for release builds
+_#latestStableGo: "1.15.8"
 _#linuxMachine:   "ubuntu-18.04"
 _#macosMachine:   "macos-10.15"
 _#windowsMachine: "windows-2019"
@@ -1398,7 +1405,7 @@
 	name: "Install Go"
 	uses: "actions/setup-go@v2"
 	with: {
-		"go-version": "${{ matrix.go-version }}"
+		"go-version": *"${{ matrix.go-version }}" | string
 		stable:       false
 	}
 }
diff --git a/cue/testdata/eval/github.txtar b/cue/testdata/eval/github.txtar
index 861d5d1..1a4c38d 100644
--- a/cue/testdata/eval/github.txtar
+++ b/cue/testdata/eval/github.txtar
@@ -194,33 +194,31 @@
 	jobs: {
 		goreleaser: {
 			"runs-on": _#linuxMachine
-			steps: [{
-				name: "Checkout code"
-				uses: "actions/checkout@v2"
-			}, {
-				name: "Unshallow"
-				run:  "git fetch --prune --unshallow"
-			}, {
+			steps: [_#checkoutCode & {
+				with: "fetch-depth": 0
+			}, _#installGo & {
+				with: version: _#latestStableGo
+			}, _#step & {
 				name: "Run GoReleaser"
 				env: GITHUB_TOKEN: "${{ secrets.ACTIONS_GITHUB_TOKEN }}"
-				uses: "docker://goreleaser/goreleaser:v0.110.0"
-				with: args: "release --rm-dist"
+				uses: "goreleaser/goreleaser-action@v2"
+				with: {
+					args:    "release --rm-dist"
+					version: "v0.155.1"
+				}
 			}]
 		}
 		docker: {
 			name:      "docker"
 			"runs-on": _#linuxMachine
-			steps: [{
-				name: "Check out the repo"
-				uses: "actions/checkout@v2"
-			}, {
+			steps: [_#checkoutCode, _#step & {
 				name: "Set version environment"
 				run: """
 					CUE_VERSION=$(echo ${GITHUB_REF##refs/tags/v})
 					echo \"CUE_VERSION=$CUE_VERSION\"
 					echo \"CUE_VERSION=$(echo $CUE_VERSION)\" >> $GITHUB_ENV
 					"""
-			}, {
+			}, _#step & {
 				name: "Push to Docker Hub"
 				env: {
 					DOCKER_BUILDKIT: 1
@@ -269,8 +267,10 @@
 }).steps & [_])[0]
 
 // We need at least go1.14 for code generation
-_#codeGenGo:      "1.14.14"
-_#latestStableGo: "1.15.x"
+_#codeGenGo: "1.14.14"
+
+// Use a specific latest version for release builds
+_#latestStableGo: "1.15.8"
 _#linuxMachine:   "ubuntu-18.04"
 _#macosMachine:   "macos-10.15"
 _#windowsMachine: "windows-2019"
@@ -286,7 +286,7 @@
 	name: "Install Go"
 	uses: "actions/setup-go@v2"
 	with: {
-		"go-version": "${{ matrix.go-version }}"
+		"go-version": *"${{ matrix.go-version }}" | string
 		stable:       false
 	}
 }
@@ -1114,7 +1114,7 @@
               matrix: (#struct){
                 "go-version": (#list){
                   0: (string){ "1.14.14" }
-                  1: (string){ "1.15.x" }
+                  1: (string){ "1.15.8" }
                   2: (string){ "1.16.0-rc1" }
                 }
                 os: (#list){
@@ -1134,7 +1134,7 @@
                 name: (string){ "Install Go" }
                 uses: (string){ "actions/setup-go@v2" }
                 with: (#struct){
-                  "go-version": (string){ "${{ matrix.go-version }}" }
+                  "go-version": (string){ |(*(string){ "${{ matrix.go-version }}" }, (string){ string }) }
                   stable: (bool){ false }
                 }
               }
@@ -1163,7 +1163,7 @@
               6: (#struct){
                 name: (string){ "Test with -race" }
                 run: (string){ "go test -race ./..." }
-                if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.15.x' && matrix.os == 'ubuntu-18.04' }}" }
+                if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }}" }
               }
               7: (#struct){
                 name: (string){ "gorelease check" }
@@ -1442,19 +1442,28 @@
               0: (#struct){
                 name: (string){ "Checkout code" }
                 uses: (string){ "actions/checkout@v2" }
+                with: (#struct){
+                  "fetch-depth": (int){ 0 }
+                }
               }
               1: (#struct){
-                name: (string){ "Unshallow" }
-                run: (string){ "git fetch --prune --unshallow" }
+                name: (string){ "Install Go" }
+                uses: (string){ "actions/setup-go@v2" }
+                with: (#struct){
+                  "go-version": (string){ |(*(string){ "${{ matrix.go-version }}" }, (string){ string }) }
+                  stable: (bool){ false }
+                  version: (string){ "1.15.8" }
+                }
               }
               2: (#struct){
                 name: (string){ "Run GoReleaser" }
                 env: (#struct){
                   GITHUB_TOKEN: (string){ "${{ secrets.ACTIONS_GITHUB_TOKEN }}" }
                 }
-                uses: (string){ "docker://goreleaser/goreleaser:v0.110.0" }
+                uses: (string){ "goreleaser/goreleaser-action@v2" }
                 with: (#struct){
                   args: (string){ "release --rm-dist" }
+                  version: (string){ "v0.155.1" }
                 }
               }
             }
@@ -1469,7 +1478,7 @@
             "runs-on": (string){ "ubuntu-18.04" }
             steps: (#list){
               0: (#struct){
-                name: (string){ "Check out the repo" }
+                name: (string){ "Checkout code" }
                 uses: (string){ "actions/checkout@v2" }
               }
               1: (#struct){
@@ -1723,7 +1732,7 @@
           matrix: (#struct){
             "go-version": (#list){
               0: (string){ "1.14.14" }
-              1: (string){ "1.15.x" }
+              1: (string){ "1.15.8" }
               2: (string){ "1.16.0-rc1" }
             }
             os: (#list){
@@ -1743,7 +1752,7 @@
             name: (string){ "Install Go" }
             uses: (string){ "actions/setup-go@v2" }
             with: (#struct){
-              "go-version": (string){ "${{ matrix.go-version }}" }
+              "go-version": (string){ |(*(string){ "${{ matrix.go-version }}" }, (string){ string }) }
               stable: (bool){ false }
             }
           }
@@ -1772,7 +1781,7 @@
           6: (#struct){
             name: (string){ "Test with -race" }
             run: (string){ "go test -race ./..." }
-            if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.15.x' && matrix.os == 'ubuntu-18.04' }}" }
+            if: (string){ "${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/ci/') && matrix.go-version == '1.15.8' && matrix.os == 'ubuntu-18.04' }}" }
           }
           7: (#struct){
             name: (string){ "gorelease check" }
@@ -2117,19 +2126,28 @@
           0: (#struct){
             name: (string){ "Checkout code" }
             uses: (string){ "actions/checkout@v2" }
+            with: (#struct){
+              "fetch-depth": (int){ 0 }
+            }
           }
           1: (#struct){
-            name: (string){ "Unshallow" }
-            run: (string){ "git fetch --prune --unshallow" }
+            name: (string){ "Install Go" }
+            uses: (string){ "actions/setup-go@v2" }
+            with: (#struct){
+              "go-version": (string){ |(*(string){ "${{ matrix.go-version }}" }, (string){ string }) }
+              stable: (bool){ false }
+              version: (string){ "1.15.8" }
+            }
           }
           2: (#struct){
             name: (string){ "Run GoReleaser" }
             env: (#struct){
               GITHUB_TOKEN: (string){ "${{ secrets.ACTIONS_GITHUB_TOKEN }}" }
             }
-            uses: (string){ "docker://goreleaser/goreleaser:v0.110.0" }
+            uses: (string){ "goreleaser/goreleaser-action@v2" }
             with: (#struct){
               args: (string){ "release --rm-dist" }
+              version: (string){ "v0.155.1" }
             }
           }
         }
@@ -2144,7 +2162,7 @@
         "runs-on": (string){ "ubuntu-18.04" }
         steps: (#list){
           0: (#struct){
-            name: (string){ "Check out the repo" }
+            name: (string){ "Checkout code" }
             uses: (string){ "actions/checkout@v2" }
           }
           1: (#struct){
@@ -2319,7 +2337,7 @@
   _#step(:ci): (#struct){
   }
   _#codeGenGo(:ci): (string){ "1.14.14" }
-  _#latestStableGo(:ci): (string){ "1.15.x" }
+  _#latestStableGo(:ci): (string){ "1.15.8" }
   _#linuxMachine(:ci): (string){ "ubuntu-18.04" }
   _#macosMachine(:ci): (string){ "macos-10.15" }
   _#windowsMachine(:ci): (string){ "windows-2019" }
@@ -2328,7 +2346,7 @@
     matrix: (#struct){
       "go-version": (#list){
         0: (string){ "1.14.14" }
-        1: (string){ "1.15.x" }
+        1: (string){ "1.15.8" }
         2: (string){ "1.16.0-rc1" }
       }
       os: (#list){
@@ -2342,7 +2360,7 @@
     name: (string){ "Install Go" }
     uses: (string){ "actions/setup-go@v2" }
     with: (#struct){
-      "go-version": (string){ "${{ matrix.go-version }}" }
+      "go-version": (string){ |(*(string){ "${{ matrix.go-version }}" }, (string){ string }) }
       stable: (bool){ false }
     }
   }
@@ -2634,39 +2652,39 @@
       goreleaser: {
         "runs-on": 〈3;_#linuxMachine〉
         steps: [
-          {
-            name: "Checkout code"
-            uses: "actions/checkout@v2"
-          },
-          {
-            name: "Unshallow"
-            run: "git fetch --prune --unshallow"
-          },
-          {
+          (〈3;_#checkoutCode〉 & {
+            with: {
+              "fetch-depth": 0
+            }
+          }),
+          (〈3;_#installGo〉 & {
+            with: {
+              version: 〈5;_#latestStableGo〉
+            }
+          }),
+          (〈3;_#step〉 & {
             name: "Run GoReleaser"
             env: {
               GITHUB_TOKEN: "${{ secrets.ACTIONS_GITHUB_TOKEN }}"
             }
-            uses: "docker://goreleaser/goreleaser:v0.110.0"
+            uses: "goreleaser/goreleaser-action@v2"
             with: {
               args: "release --rm-dist"
+              version: "v0.155.1"
             }
-          },
+          }),
         ]
       }
       docker: {
         name: "docker"
         "runs-on": 〈3;_#linuxMachine〉
         steps: [
-          {
-            name: "Check out the repo"
-            uses: "actions/checkout@v2"
-          },
-          {
+          〈3;_#checkoutCode〉,
+          (〈3;_#step〉 & {
             name: "Set version environment"
             run: "CUE_VERSION=$(echo ${GITHUB_REF##refs/tags/v})\necho \"CUE_VERSION=$CUE_VERSION\"\necho \"CUE_VERSION=$(echo $CUE_VERSION)\" >> $GITHUB_ENV"
-          },
-          {
+          }),
+          (〈3;_#step〉 & {
             name: "Push to Docker Hub"
             env: {
               DOCKER_BUILDKIT: 1
@@ -2686,7 +2704,7 @@
               build_args: "GOLANG_VERSION=${{ env.GOLANG_VERSION }},CUE_VERSION=v${{ env.CUE_VERSION }}"
               add_git_labels: true
             }
-          },
+          }),
         ]
       }
     }
@@ -2732,7 +2750,7 @@
     _,
   ])[0]
   _#codeGenGo: "1.14.14"
-  _#latestStableGo: "1.15.x"
+  _#latestStableGo: "1.15.8"
   _#linuxMachine: "ubuntu-18.04"
   _#macosMachine: "macos-10.15"
   _#windowsMachine: "windows-2019"
@@ -2755,7 +2773,7 @@
     name: "Install Go"
     uses: "actions/setup-go@v2"
     with: {
-      "go-version": "${{ matrix.go-version }}"
+      "go-version": (*"${{ matrix.go-version }}"|string)
       stable: false
     }
   })
diff --git a/internal/ci/workflows.cue b/internal/ci/workflows.cue
index 3604821..e068f45 100644
--- a/internal/ci/workflows.cue
+++ b/internal/ci/workflows.cue
@@ -250,53 +250,59 @@
 	jobs: {
 		goreleaser: {
 			"runs-on": _#linuxMachine
-			steps: [{
-				name: "Checkout code"
-				uses: "actions/checkout@v2"
-			}, {
-				name: "Unshallow" // required for the changelog to work correctly.
-				run:  "git fetch --prune --unshallow"
-			}, {
-				name: "Run GoReleaser"
-				env: GITHUB_TOKEN: "${{ secrets.ACTIONS_GITHUB_TOKEN }}"
-				uses: "docker://goreleaser/goreleaser:v0.110.0"
-				with: args: "release --rm-dist"
-			}]
+			steps: [
+				_#checkoutCode & {
+					with: "fetch-depth": 0
+				},
+				_#installGo & {
+					with: version: _#latestStableGo
+				},
+				_#step & {
+					name: "Run GoReleaser"
+					env: GITHUB_TOKEN: "${{ secrets.ACTIONS_GITHUB_TOKEN }}"
+					uses: "goreleaser/goreleaser-action@v2"
+					with: {
+						args:    "release --rm-dist"
+						version: "v0.155.1"
+					}
+				},
+			]
 		}
 		docker: {
 			name:      "docker"
 			"runs-on": _#linuxMachine
-			steps: [{
-				name: "Check out the repo"
-				uses: "actions/checkout@v2"
-			}, {
-				name: "Set version environment"
-				run: """
-					CUE_VERSION=$(echo ${GITHUB_REF##refs/tags/v})
-					echo \"CUE_VERSION=$CUE_VERSION\"
-					echo \"CUE_VERSION=$(echo $CUE_VERSION)\" >> $GITHUB_ENV
-					"""
-			}, {
-				name: "Push to Docker Hub"
-				env: {
-					DOCKER_BUILDKIT: 1
-					GOLANG_VERSION:  1.14
-					CUE_VERSION:     "${{ env.CUE_VERSION }}"
-				}
-				uses: "docker/build-push-action@v1"
-				with: {
-					tags:           "${{ env.CUE_VERSION }},latest"
-					repository:     "cuelang/cue"
-					username:       "${{ secrets.DOCKER_USERNAME }}"
-					password:       "${{ secrets.DOCKER_PASSWORD }}"
-					tag_with_ref:   false
-					tag_with_sha:   false
-					target:         "cue"
-					always_pull:    true
-					build_args:     "GOLANG_VERSION=${{ env.GOLANG_VERSION }},CUE_VERSION=v${{ env.CUE_VERSION }}"
-					add_git_labels: true
-				}
-			}]
+			steps: [
+				_#checkoutCode,
+				_#step & {
+					name: "Set version environment"
+					run: """
+						CUE_VERSION=$(echo ${GITHUB_REF##refs/tags/v})
+						echo \"CUE_VERSION=$CUE_VERSION\"
+						echo \"CUE_VERSION=$(echo $CUE_VERSION)\" >> $GITHUB_ENV
+						"""
+				},
+				_#step & {
+					name: "Push to Docker Hub"
+					env: {
+						DOCKER_BUILDKIT: 1
+						GOLANG_VERSION:  1.14
+						CUE_VERSION:     "${{ env.CUE_VERSION }}"
+					}
+					uses: "docker/build-push-action@v1"
+					with: {
+						tags:           "${{ env.CUE_VERSION }},latest"
+						repository:     "cuelang/cue"
+						username:       "${{ secrets.DOCKER_USERNAME }}"
+						password:       "${{ secrets.DOCKER_PASSWORD }}"
+						tag_with_ref:   false
+						tag_with_sha:   false
+						target:         "cue"
+						always_pull:    true
+						build_args:     "GOLANG_VERSION=${{ env.GOLANG_VERSION }},CUE_VERSION=v${{ env.CUE_VERSION }}"
+						add_git_labels: true
+					}
+				},
+			]
 		}
 	}
 }
@@ -324,8 +330,10 @@
 _#step: ((_#job & {steps:                 _}).steps & [_])[0]
 
 // We need at least go1.14 for code generation
-_#codeGenGo:      "1.14.14"
-_#latestStableGo: "1.15.x"
+_#codeGenGo: "1.14.14"
+
+// Use a specific latest version for release builds
+_#latestStableGo: "1.15.8"
 
 _#linuxMachine:   "ubuntu-18.04"
 _#macosMachine:   "macos-10.15"
@@ -344,7 +352,7 @@
 	name: "Install Go"
 	uses: "actions/setup-go@v2"
 	with: {
-		"go-version": "${{ matrix.go-version }}"
+		"go-version": *"${{ matrix.go-version }}" | string
 		stable:       false
 	}
 }