Fix publish bazel binary on Windows
diff --git a/buildkite/bazelci.py b/buildkite/bazelci.py
index b047c3a..f63a596 100644
--- a/buildkite/bazelci.py
+++ b/buildkite/bazelci.py
@@ -366,7 +366,7 @@
update_pull_request_build_status(
platform, git_repository, commit, "success", invocation_id)
if save_but:
- upload_bazel_binary()
+ upload_bazel_binary(platform)
except BazelBuildFailedException:
if is_pull_request():
invocation_id = bes_invocation_id(build_bep_file)
@@ -550,16 +550,24 @@
execute_command([bazel_binary, "info"])
-def upload_bazel_binary():
+def upload_bazel_binary(platform):
print_collapsed_group(":gcloud: Uploading Bazel Under Test")
+ binary_path = "bazel-bin/src/bazel"
+ if platform == "windows":
+ binary_path = "bazel-bin\src\bazel"
+
execute_command(["buildkite-agent", "artifact",
"upload", "bazel-bin/src/bazel"])
def download_bazel_binary(dest_dir, platform):
+ binary_path = "bazel-bin/src/bazel"
+ if platform == "windows":
+ binary_path = "bazel-bin\src\bazel"
+
source_step = create_label(platform, "Bazel", build_only=True)
execute_command(["buildkite-agent", "artifact", "download",
- "bazel-bin/src/bazel", dest_dir, "--step", source_step])
+ binary_path, dest_dir, "--step", source_step])
bazel_binary_path = os.path.join(dest_dir, "bazel-bin/src/bazel")
st = os.stat(bazel_binary_path)
os.chmod(bazel_binary_path, st.st_mode | stat.S_IEXEC)