xref: /aosp_15_r20/external/stardoc/distro/BUILD (revision b2fa42943c124aa9c7163734493fc7a7559681cf)
1load("@io_bazel_stardoc//:version.bzl", "version")
2load("@rules_pkg//:pkg.bzl", "pkg_tar")
3
4package(
5    default_visibility = ["//visibility:private"],
6)
7
8alias(
9    name = "distro",
10    actual = "stardoc-%s" % version,
11)
12
13genrule(
14    name = "distro_workspace",
15    srcs = ["//:WORKSPACE"],
16    outs = ["WORKSPACE"],
17    cmd = "sed -e '/### INTERNAL ONLY/,$$d' $(location //:WORKSPACE) >$@",
18)
19
20pkg_tar(
21    name = "distro_srcs",
22    srcs = [
23        "distro_workspace",
24        "//:distro_srcs",
25    ],
26    mode = "0644",
27    # Make it owned by root so it does not have the uid of the CI robot.
28    owner = "0.0",
29    package_dir = "",
30    strip_prefix = ".",
31)
32
33pkg_tar(
34    name = "distro_bins",
35    srcs = ["//:distro_bins"],
36    mode = "0755",
37    # Make it owned by root so it does not have the uid of the CI robot.
38    owner = "0.0",
39    package_dir = "",
40    strip_prefix = ".",
41)
42
43# Build the artifact to put on the github release page.
44pkg_tar(
45    name = "stardoc-%s" % version,
46    extension = "tar.gz",
47    # Make it owned by root so it does not have the uid of the CI robot.
48    owner = "0.0",
49    strip_prefix = ".",
50    deps = [
51        ":distro_bins.tar",
52        ":distro_srcs.tar",
53    ],
54)
55