aboutsummaryrefslogtreecommitdiff
path: root/distro/BUILD
diff options
context:
space:
mode:
authorTony Aiuto <aiuto@google.com>2022-01-24 15:26:09 -0500
committerTony Aiuto <aiuto@google.com>2022-01-24 15:26:09 -0500
commit3c12b7b7ce7c361ef2b7b965568280f13029c8ce (patch)
tree3b24f54cce06c453aaf9a938be988a9d6ebc628c /distro/BUILD
parentff0f054ef89373a3f8cb69a7bf6dbdc5b29aa748 (diff)
downloadbazelbuild-rules_license-3c12b7b7ce7c361ef2b7b965568280f13029c8ce.tar.gz
first cut at making a release binary
Diffstat (limited to 'distro/BUILD')
-rw-r--r--distro/BUILD69
1 files changed, 69 insertions, 0 deletions
diff --git a/distro/BUILD b/distro/BUILD
new file mode 100644
index 0000000..c175f18
--- /dev/null
+++ b/distro/BUILD
@@ -0,0 +1,69 @@
+# Copyright 2022 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+load("//:version.bzl", "version")
+load("@rules_pkg//pkg:pkg.bzl", "pkg_tar")
+load("@rules_pkg//pkg/releasing:defs.bzl", "print_rel_notes")
+
+
+package(
+ default_visibility = ["//visibility:private"],
+ default_applicable_licenses = ["//:license"],
+)
+
+alias(
+ name = "distro",
+ actual = "rules_license-%s" % version,
+)
+
+# Build the artifact to put on the github release page.
+pkg_tar(
+ name = "rules_license-%s" % version,
+ srcs = [
+ ":small_workspace",
+ "//:standard_package",
+ "//licenses/spdx:standard_package",
+ "//rules:standard_package",
+ "//tools:standard_package",
+ ],
+ extension = "tar.gz",
+ # It is all source code, so make it read-only.
+ mode = "0444",
+ # Make it owned by root so it does not have the uid of the CI robot.
+ owner = "0.0",
+ package_dir = ".",
+ strip_prefix = ".",
+ tags = [
+ "no_windows",
+ ],
+)
+
+genrule(
+ name = "small_workspace",
+ srcs = ["//:WORKSPACE"],
+ outs = ["WORKSPACE"],
+ cmd = "sed -e '/### INTERNAL ONLY/,$$d' $(location //:WORKSPACE) >$@",
+ tags = [
+ "no_windows",
+ ],
+)
+
+print_rel_notes(
+ name = "relnotes",
+ outs = ["relnotes.txt"],
+ mirror_host = "mirror.bazel.build",
+ org = "bazelbuild",
+ repo = "rules_license",
+ version = version,
+)