diff --git a/.bazelversion b/.bazelversion index 01f266ec..0a87f52a 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1,4 +1,4 @@ -7.4.1 +7.5.0 # The first line of this file is used by Bazelisk and Bazel to be sure # the right version of Bazel is used to build and test this repo. diff --git a/.bcr/source.template.json b/.bcr/source.template.json index 1e088faf..b2825d9b 100644 --- a/.bcr/source.template.json +++ b/.bcr/source.template.json @@ -1,5 +1,6 @@ { "integrity": "**leave this alone**", "strip_prefix": "{REPO}-{VERSION}", + "docs_url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/rules_oci-{TAG}.docs.tar.gz", "url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/rules_oci-{TAG}.tar.gz" } diff --git a/.github/workflows/release_prep.sh b/.github/workflows/release_prep.sh index 4fec95ec..9756a32f 100755 --- a/.github/workflows/release_prep.sh +++ b/.github/workflows/release_prep.sh @@ -11,6 +11,14 @@ ARCHIVE="rules_oci-$TAG.tar.gz" git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}') +# Add generated API docs to the release, see https://github.com/bazelbuild/bazel-central-registry/issues/5593 +docs="$(mktemp -d)"; targets="$(mktemp)" +bazel --output_base="$docs" query --output=label --output_file="$targets" 'kind("starlark_doc_extract rule", //...)' +bazel --output_base="$docs" build --target_pattern_file="$targets" --remote_download_regex='.*doc_extract\.binaryproto' +tar --create --auto-compress \ + --directory "$(bazel --output_base="$docs" info bazel-bin)" \ + --file "$GITHUB_WORKSPACE/${ARCHIVE%.tar.gz}.docs.tar.gz" . + cat << EOF ## Using bzlmod with Bazel 6 or later: diff --git a/BUILD.bazel b/BUILD.bazel index 42b9fafb..b3262df4 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -6,6 +6,8 @@ gazelle_binary( ) # gazelle:exclude examples/** +# gazelle:exclude fetch.bzl +# gazelle:map_kind bzl_library bzl_library @bazel_lib//:bzl_library.bzl gazelle( name = "gazelle", gazelle = "gazelle_bin", diff --git a/MODULE.bazel b/MODULE.bazel index 5d2d23db..ef6224d1 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -6,6 +6,7 @@ module( ) bazel_dep(name = "aspect_bazel_lib", version = "2.7.2") +bazel_dep(name = "bazel_lib", version = "3.0.0-beta.1") bazel_dep(name = "bazel_features", version = "1.10.0") bazel_dep(name = "bazel_skylib", version = "1.5.0") bazel_dep(name = "platforms", version = "0.0.8") diff --git a/cosign/BUILD.bazel b/cosign/BUILD.bazel index 82e12260..b25a65bb 100644 --- a/cosign/BUILD.bazel +++ b/cosign/BUILD.bazel @@ -1,4 +1,4 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@bazel_lib//:bzl_library.bzl", "bzl_library") toolchain_type( name = "toolchain_type", diff --git a/cosign/private/BUILD.bazel b/cosign/private/BUILD.bazel index a37bf0ec..0c85f83f 100644 --- a/cosign/private/BUILD.bazel +++ b/cosign/private/BUILD.bazel @@ -1,4 +1,4 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@bazel_lib//:bzl_library.bzl", "bzl_library") exports_files( glob(["*.bzl"]), @@ -11,21 +11,15 @@ exports_files([ ]) bzl_library( - name = "sign", - srcs = ["sign.bzl"], - visibility = [ - "//cosign:__subpackages__", - "//docs:__pkg__", - ], + name = "attest", + srcs = ["attest.bzl"], + visibility = ["//cosign:__subpackages__"], ) bzl_library( - name = "attest", - srcs = ["attest.bzl"], - visibility = [ - "//cosign:__subpackages__", - "//docs:__pkg__", - ], + name = "sign", + srcs = ["sign.bzl"], + visibility = ["//cosign:__subpackages__"], ) bzl_library( diff --git a/docs/image.md b/docs/image.md index 9fcc7166..1c5e9b60 100644 --- a/docs/image.md +++ b/docs/image.md @@ -11,6 +11,8 @@ load("@rules_oci//oci:defs.bzl", ...) ## oci_image_rule
+load("@rules_oci//oci:defs.bzl", "oci_image_rule")
+
 oci_image_rule(name, annotations, architecture, base, cmd, created, entrypoint, env, exposed_ports,
                labels, os, resource_set, tars, user, variant, volumes, workdir)
 
@@ -91,6 +93,8 @@ oci_image( ## oci_image
+load("@rules_oci//oci:defs.bzl", "oci_image")
+
 oci_image(name, created, labels, annotations, env, cmd, entrypoint, exposed_ports, volumes, kwargs)
 
diff --git a/docs/image_index.md b/docs/image_index.md index b9351494..d217229c 100644 --- a/docs/image_index.md +++ b/docs/image_index.md @@ -11,6 +11,8 @@ load("@rules_oci//oci:defs.bzl", ...) ## oci_image_index_rule
+load("@rules_oci//oci:defs.bzl", "oci_image_index_rule")
+
 oci_image_index_rule(name, images, platforms)
 
@@ -86,6 +88,8 @@ oci_image_index( ## oci_image_index
+load("@rules_oci//oci:defs.bzl", "oci_image_index")
+
 oci_image_index(name, kwargs)
 
diff --git a/docs/load.md b/docs/load.md index 67fbdc92..2391b099 100644 --- a/docs/load.md +++ b/docs/load.md @@ -25,6 +25,8 @@ docker run --rm my-repository:latest ## oci_load
+load("@rules_oci//oci/private:load.bzl", "oci_load")
+
 oci_load(name, format, image, loader, repo_tags)
 
diff --git a/docs/pull.md b/docs/pull.md index 2301c66e..1dc2a26c 100644 --- a/docs/pull.md +++ b/docs/pull.md @@ -161,6 +161,8 @@ In this example, we provide a `www_authenticate_challenges` attribute to the `oc ## oci_pull
+load("@rules_oci//oci:pull.bzl", "oci_pull")
+
 oci_pull(name, www_authenticate_challenges, image, repository, registry, platforms, digest, tag,
          reproducible, is_bzlmod, config, bazel_tags)
 
diff --git a/docs/push.md b/docs/push.md index 89ce6196..05e7e5dd 100644 --- a/docs/push.md +++ b/docs/push.md @@ -11,6 +11,8 @@ load("@rules_oci//oci:defs.bzl", ...) ## oci_push_rule
+load("@rules_oci//oci:defs.bzl", "oci_push_rule")
+
 oci_push_rule(name, image, remote_tags, repository, repository_file)
 
@@ -167,6 +169,8 @@ multirun( ## oci_push
+load("@rules_oci//oci:defs.bzl", "oci_push")
+
 oci_push(name, remote_tags, kwargs)
 
diff --git a/oci/BUILD.bazel b/oci/BUILD.bazel index f1a9530f..250eb782 100644 --- a/oci/BUILD.bazel +++ b/oci/BUILD.bazel @@ -1,5 +1,5 @@ load("@aspect_bazel_lib//lib:utils.bzl", bazel_lib_utils = "utils") -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@bazel_lib//:bzl_library.bzl", "bzl_library") exports_files( glob(["*.bzl"]), diff --git a/oci/private/BUILD.bazel b/oci/private/BUILD.bazel index 0f234949..c58ab94c 100644 --- a/oci/private/BUILD.bazel +++ b/oci/private/BUILD.bazel @@ -1,4 +1,4 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") +load("@bazel_lib//:bzl_library.bzl", "bzl_library") exports_files( glob(["*.bzl"]), @@ -37,15 +37,6 @@ bzl_library( ], ) -bzl_library( - name = "image_index", - srcs = ["image_index.bzl"], - visibility = [ - "//docs:__pkg__", - "//oci:__subpackages__", - ], -) - bzl_library( name = "pull", srcs = ["pull.bzl"], @@ -72,21 +63,6 @@ bzl_library( ], ) -bzl_library( - name = "toolchains_repo", - srcs = ["toolchains_repo.bzl"], - visibility = [ - "//cosign:__subpackages__", - "//oci:__subpackages__", - ], -) - -bzl_library( - name = "versions", - srcs = ["versions.bzl"], - visibility = ["//oci:__subpackages__"], -) - bzl_library( name = "authn", srcs = ["authn.bzl"], @@ -107,3 +83,24 @@ bzl_library( "@bazel_skylib//lib:versions", ], ) + +bzl_library( + name = "image_index", + srcs = ["image_index.bzl"], + visibility = ["//oci:__subpackages__"], +) + +bzl_library( + name = "toolchains_repo", + srcs = ["toolchains_repo.bzl"], + visibility = [ + "//cosign:__subpackages__", + "//oci:__subpackages__", + ], +) + +bzl_library( + name = "versions", + srcs = ["versions.bzl"], + visibility = ["//oci:__subpackages__"], +)