aboutsummaryrefslogtreecommitdiff
path: root/distribution/BUILD
diff options
context:
space:
mode:
authorAlexandre Rostovtsev <arostovtsev@google.com>2023-01-20 16:48:10 -0500
committerGitHub <noreply@github.com>2023-01-20 16:48:10 -0500
commit99a6bcb240e38495d45290a91357c41fd4821b61 (patch)
treecdf00b9433787a5d97c727498606fb6bfa91661f /distribution/BUILD
parent5bfcb1a684550626ce138fe0fe8f5f702b3764c3 (diff)
downloadbazel-skylib-99a6bcb240e38495d45290a91357c41fd4821b61.tar.gz
Add gazelle plugin to CI and distribution mechanism (#424)
After #400, the gazelle plugin has been cleanly separated out into its own bazel workspace, which will soon finally allow us to mark it stable. But this means: * we need to change our bazelci config to explicitly build and test it, since `bazel build //...` no longer includes the plugin; * we need to add proper distribution rules for it; * we need to update release instructions, since now we will have two distribution tarballs
Diffstat (limited to 'distribution/BUILD')
-rw-r--r--distribution/BUILD44
1 files changed, 33 insertions, 11 deletions
diff --git a/distribution/BUILD b/distribution/BUILD
index 326cee7..8762525 100644
--- a/distribution/BUILD
+++ b/distribution/BUILD
@@ -1,6 +1,6 @@
load("@bazel_skylib//:version.bzl", "version")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
-load("@rules_pkg//releasing:defs.bzl", "print_rel_notes")
+load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
package(
default_visibility = ["//visibility:private"],
@@ -13,25 +13,47 @@ genrule(
cmd = "sed -e '/### INTERNAL ONLY/,$$d' $(location //:MODULE.bazel) >$@",
)
-# Build the artifact to put on the github release page.
+# Build the artifacts to put on the github release page.
pkg_tar(
- name = "bazel-skylib-%s" % version,
+ name = "bazel-skylib",
srcs = [
"distro_module_bazel",
"//:distribution",
],
+ out = "bazel-skylib-%s.tar.gz" % version,
extension = "tar.gz",
mode = "0644",
# Make it owned by root so it does not have the uid of the CI robot.
owner = "0.0",
- strip_prefix = ".",
+ strip_prefix = strip_prefix.from_root(),
)
-print_rel_notes(
- name = "relnotes",
- outs = ["relnotes.txt"],
- deps_method = "bazel_skylib_workspace",
- repo = "bazel-skylib",
- setup_file = ":workspace.bzl",
- version = version,
+pkg_files(
+ name = "bazel-skylib-gazelle-plugin-without-external-prefix",
+ srcs = [
+ "@bazel_skylib_gazelle_plugin//:distribution",
+ "@bazel_skylib_gazelle_plugin//bzl:distribution",
+ ],
+ strip_prefix = strip_prefix.from_root(),
+)
+
+pkg_tar(
+ name = "bazel-skylib-gazelle-plugin",
+ srcs = [
+ ":bazel-skylib-gazelle-plugin-without-external-prefix",
+ "//:LICENSE",
+ ],
+ out = "bazel-skylib-gazelle-plugin-%s.tar.gz" % version,
+ extension = "tar.gz",
+ mode = "0644",
+ # Make it owned by root so it does not have the uid of the CI robot.
+ owner = "0.0",
+)
+
+filegroup(
+ name = "distribution",
+ srcs = [
+ "bazel-skylib",
+ "bazel-skylib-gazelle-plugin",
+ ],
)