2021-12-11 19:39:41 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -o errexit -o nounset -o pipefail
|
|
|
|
|
|
|
|
# Set by GH actions, see
|
|
|
|
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
|
|
|
|
TAG=${GITHUB_REF_NAME}
|
2021-12-11 20:43:57 +00:00
|
|
|
PREFIX="bazel-lib-${TAG:1}"
|
|
|
|
SHA=$(git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip | shasum -a 256 | awk '{print $1}')
|
2021-12-11 19:39:41 +00:00
|
|
|
|
|
|
|
cat << EOF
|
|
|
|
|
|
|
|
WORKSPACE snippet:
|
|
|
|
|
|
|
|
\`\`\`starlark
|
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
|
|
|
|
http_archive(
|
|
|
|
name = "aspect_bazel_lib",
|
|
|
|
sha256 = "${SHA}",
|
2021-12-11 20:43:57 +00:00
|
|
|
strip_prefix = "${PREFIX}",
|
2021-12-11 19:39:41 +00:00
|
|
|
url = "https://github.com/aspect-build/bazel-lib/archive/${TAG}.tar.gz",
|
|
|
|
)
|
2021-12-15 19:51:29 +00:00
|
|
|
|
|
|
|
load("@aspect_bazel_lib", "aspect_bazel_lib_dependencies")
|
|
|
|
|
|
|
|
aspect_bazel_lib_dependencies()
|
|
|
|
|
|
|
|
# Optional: register the following toolchain to use jq
|
|
|
|
|
|
|
|
load("@aspect_bazel_lib", "register_jq_toolchains")
|
|
|
|
|
|
|
|
register_jq_toolchains(version = "1.6")
|
|
|
|
|
2021-12-11 19:39:41 +00:00
|
|
|
\`\`\`
|
|
|
|
EOF
|