cmd/releasebot: build cmd/release in module mode

Fixes golang/go#36950.

Change-Id: I4eafcc97536b104bdb0f683745bfef673612af1a
Reviewed-on: https://go-review.googlesource.com/c/build/+/334109
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
diff --git a/cmd/releasebot/main.go b/cmd/releasebot/main.go
index 54099cd..a7d2c6d 100644
--- a/cmd/releasebot/main.go
+++ b/cmd/releasebot/main.go
@@ -652,14 +652,15 @@
 
 func (w *Work) buildReleaseBinary() {
 	gopath := filepath.Join(w.Dir, "gopath")
+	r := w.runner(w.Dir, "GOPATH="+gopath, "GOBIN="+filepath.Join(gopath, "bin"))
+	r.run("go", "clean", "-modcache")
 	if err := os.RemoveAll(gopath); err != nil {
 		w.log.Panic(err)
 	}
 	if err := os.MkdirAll(gopath, 0777); err != nil {
 		w.log.Panic(err)
 	}
-	r := w.runner(w.Dir, "GO111MODULE=off", "GOPATH="+gopath, "GOBIN="+filepath.Join(gopath, "bin"))
-	r.run("go", "get", "golang.org/x/build/cmd/release")
+	r.run("go", "install", "golang.org/x/build/cmd/release@latest")
 	w.ReleaseBinary = filepath.Join(gopath, "bin/release")
 }