Enable remote caching in bazel-release pipeline (#2925)

Configure RBE caching for Linux and Windows, and GCS caching for macOS,
using cache-silo-key=bazel-release for cache isolation.
diff --git a/pipelines/bazel-release.yml b/pipelines/bazel-release.yml
index 164fc22..717c769 100644
--- a/pipelines/bazel-release.yml
+++ b/pipelines/bazel-release.yml
@@ -72,7 +72,15 @@
       release_name=$(buildkite-agent meta-data get "release_name")
       echo "release_name = \"\$release_name\""
 
-      bazel build --sandbox_tmpfs_path=/tmp //src:bazel
+      bazel build \
+          --remote_cache=remotebuildexecution.googleapis.com \
+          --remote_instance_name=projects/bazel-public/instances/default_instance \
+          --google_default_credentials \
+          --remote_timeout=60 \
+          --remote_max_connections=200 \
+          --remote_default_exec_properties=cache-silo-key=bazel-release \
+          --sandbox_tmpfs_path=/tmp \
+          //src:bazel
       mkdir output
       cp bazel-bin/src/bazel output/bazel
 
@@ -80,6 +88,12 @@
       output/bazel mod deps --lockfile_mode=update
 
       output/bazel build \
+          --remote_cache=remotebuildexecution.googleapis.com \
+          --remote_instance_name=projects/bazel-public/instances/default_instance \
+          --google_default_credentials \
+          --remote_timeout=60 \
+          --remote_max_connections=200 \
+          --remote_default_exec_properties=cache-silo-key=bazel-release \
           -c opt \
           --stamp \
           --sandbox_tmpfs_path=/tmp \
@@ -134,11 +148,25 @@
       release_name=$(buildkite-agent meta-data get "release_name")
       echo "release_name = \"\$release_name\""
 
-      bazel build --sandbox_tmpfs_path=/tmp //src:bazel
+      bazel build \
+          --remote_cache=remotebuildexecution.googleapis.com \
+          --remote_instance_name=projects/bazel-public/instances/default_instance \
+          --google_default_credentials \
+          --remote_timeout=60 \
+          --remote_max_connections=200 \
+          --remote_default_exec_properties=cache-silo-key=bazel-release \
+          --sandbox_tmpfs_path=/tmp \
+          //src:bazel
       mkdir output
       cp bazel-bin/src/bazel output/bazel
 
       output/bazel build \
+          --remote_cache=remotebuildexecution.googleapis.com \
+          --remote_instance_name=projects/bazel-public/instances/default_instance \
+          --google_default_credentials \
+          --remote_timeout=60 \
+          --remote_max_connections=200 \
+          --remote_default_exec_properties=cache-silo-key=bazel-release \
           -c opt \
           --stamp \
           --sandbox_tmpfs_path=/tmp \
@@ -166,11 +194,22 @@
       release_name=$(buildkite-agent meta-data get "release_name")
       echo "release_name = \"\$release_name\""
 
-      bazel build //src:bazel
+      bazel build \
+          --remote_cache=https://storage.googleapis.com/bazel-trusted-build-cache \
+          --google_default_credentials \
+          --remote_timeout=3600 \
+          --remote_max_connections=200 \
+          --remote_default_exec_properties=cache-silo-key=bazel-release \
+          //src:bazel
       mkdir output
       cp bazel-bin/src/bazel output/bazel
 
       output/bazel build \
+          --remote_cache=https://storage.googleapis.com/bazel-trusted-build-cache \
+          --google_default_credentials \
+          --remote_timeout=3600 \
+          --remote_max_connections=200 \
+          --remote_default_exec_properties=cache-silo-key=bazel-release \
           --define IPHONE_SDK=1 \
           -c opt \
           --stamp \
@@ -198,11 +237,22 @@
       release_name=$(buildkite-agent meta-data get "release_name")
       echo "release_name = \"\$release_name\""
 
-      bazel build //src:bazel
+      bazel build \
+          --remote_cache=https://storage.googleapis.com/bazel-trusted-build-cache \
+          --google_default_credentials \
+          --remote_timeout=3600 \
+          --remote_max_connections=200 \
+          --remote_default_exec_properties=cache-silo-key=bazel-release \
+          //src:bazel
       mkdir output
       cp bazel-bin/src/bazel output/bazel
 
       output/bazel build \
+          --remote_cache=https://storage.googleapis.com/bazel-trusted-build-cache \
+          --google_default_credentials \
+          --remote_timeout=3600 \
+          --remote_max_connections=200 \
+          --remote_default_exec_properties=cache-silo-key=bazel-release \
           --define IPHONE_SDK=1 \
           -c opt \
           --stamp \
@@ -236,11 +286,33 @@
 
       echo Release: %RELEASE_NAME%
 
-      bazel build //src:bazel.exe
+      bazel build ^
+          --remote_cache=remotebuildexecution.googleapis.com ^
+          --remote_instance_name=projects/bazel-public/instances/default_instance ^
+          --google_default_credentials ^
+          --remote_timeout=60 ^
+          --remote_max_connections=200 ^
+          --remote_default_exec_properties=cache-silo-key=bazel-release ^
+          //src:bazel.exe
       mkdir output
       copy bazel-bin\src\bazel.exe output\bazel.exe
 
-      output\bazel build -c opt --copt=-w --host_copt=-w --stamp --embed_label %RELEASE_NAME% src/bazel src/bazel_nojdk scripts/packages/bazel.zip scripts/packages/bazel_nojdk.zip
+      output\bazel build ^
+          --remote_cache=remotebuildexecution.googleapis.com ^
+          --remote_instance_name=projects/bazel-public/instances/default_instance ^
+          --google_default_credentials ^
+          --remote_timeout=60 ^
+          --remote_max_connections=200 ^
+          --remote_default_exec_properties=cache-silo-key=bazel-release ^
+          -c opt ^
+          --copt=-w ^
+          --host_copt=-w ^
+          --stamp ^
+          --embed_label %RELEASE_NAME% ^
+          src/bazel ^
+          src/bazel_nojdk ^
+          scripts/packages/bazel.zip ^
+          scripts/packages/bazel_nojdk.zip
 
       mkdir artifacts
       move bazel-bin\src\bazel artifacts\bazel-%RELEASE_NAME%-windows-x86_64.exe
@@ -268,11 +340,34 @@
 
       echo Release: %RELEASE_NAME%
 
-      bazel build //src:bazel.exe
+      bazel build ^
+          --remote_cache=remotebuildexecution.googleapis.com ^
+          --remote_instance_name=projects/bazel-public/instances/default_instance ^
+          --google_default_credentials ^
+          --remote_timeout=60 ^
+          --remote_max_connections=200 ^
+          --remote_default_exec_properties=cache-silo-key=bazel-release ^
+          //src:bazel.exe
       mkdir output
       copy bazel-bin\src\bazel.exe output\bazel.exe
 
-      output\bazel build -c opt --config=windows_arm64 --copt=-w --host_copt=-w --stamp --embed_label %RELEASE_NAME% src/bazel src/bazel_nojdk scripts/packages/bazel.zip scripts/packages/bazel_nojdk.zip
+      output\bazel build ^
+          --remote_cache=remotebuildexecution.googleapis.com ^
+          --remote_instance_name=projects/bazel-public/instances/default_instance ^
+          --google_default_credentials ^
+          --remote_timeout=60 ^
+          --remote_max_connections=200 ^
+          --remote_default_exec_properties=cache-silo-key=bazel-release ^
+          -c opt ^
+          --config=windows_arm64 ^
+          --copt=-w ^
+          --host_copt=-w ^
+          --stamp ^
+          --embed_label %RELEASE_NAME% ^
+          src/bazel ^
+          src/bazel_nojdk ^
+          scripts/packages/bazel.zip ^
+          scripts/packages/bazel_nojdk.zip
 
       mkdir artifacts
       move bazel-bin\src\bazel artifacts\bazel-%RELEASE_NAME%-windows-arm64.exe