Create Windows ZIP release artifact using Bazel
The new pipeline does not support ziping artifact which was
a custom hack for Windows, relies on Bazel to generate those
zip instead.
Step forward fixing bazelbuild/continuous-integration#101
To cherry-pick for
@@ -15,7 +15,10 @@ filegroup(
filegroup(
name = "packages",
srcs = select({
- "//src:windows": [],
+ "//src:windows": [
+ ":zip-bazel-exe",
+ ":zip-bazel-exe_with_jdk",
+ ],
"//src:windows_msvc": [],
"//src:freebsd": [],
"//src:darwin": [
@@ -52,6 +55,22 @@ genrule(
tools = [":package-info-generator"],
)
+[genrule(
+ name = "zip-bazel-exe" + suffix,
+ srcs = ["//src:bazel%s.exe" % suffix],
+ outs = ["bazel%s.zip" % suffix],
+ cmd = "\n".join([
+ "tmpdir=$$(mktemp -d $${TMPDIR:-/tmp}/tmp.XXXXXXXX)",
+ "trap \"rm -fr $${tmpdir}\" EXIT",
+ "mv $(SRCS) $${tmpdir}/bazel.exe",
+ "touch -t 198001010000.00 $${tmpdir}/bazel.exe",
+ "zip -jq $@ $${tmpdir}/bazel.exe",
+ ]),
+) for suffix in [
+ "",
+ "_with_jdk",
+]]
+
genrule(
name = "generate-launcher",
srcs = [
