Skip to content

Commit

Permalink
Create Windows ZIP release artifact using Bazel
Browse files Browse the repository at this point in the history
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 #3375.

Change-Id: Id566d66bb179096d60c5b535f245d64cea28c5b8
PiperOrigin-RevId: 163054883
  • Loading branch information
damienmg authored and buchgr committed Jul 25, 2017
1 parent 4e9190a commit 9a63aff
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion scripts/packages/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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 = [
Expand Down

0 comments on commit 9a63aff

Please sign in to comment.