diff --git a/.github/workflows/release_prep.sh b/.github/workflows/release_prep.sh index 02cead59..c10c096e 100755 --- a/.github/workflows/release_prep.sh +++ b/.github/workflows/release_prep.sh @@ -6,7 +6,7 @@ set -o errexit -o nounset -o pipefail # https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables TAG=${GITHUB_REF_NAME} # The prefix is chosen to match what GitHub generates for source archives -PREFIX="rules_foreign_cc-${TAG:1}" +PREFIX="rules_foreign_cc-${TAG}" ARCHIVE="rules_foreign_cc-$TAG.tar.gz" git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}') @@ -18,7 +18,7 @@ cat << EOF 2. Add to your \`MODULE.bazel\` file: \`\`\`starlark -bazel_dep(name = "rules_foreign_cc", version = "${TAG:1}") +bazel_dep(name = "rules_foreign_cc", version = "${TAG}") \`\`\` ## Using WORKSPACE @@ -33,8 +33,14 @@ http_archive( strip_prefix = "${PREFIX}", url = "https://github.com/bazelbuild/rules_foreign_cc/releases/download/${TAG}/${ARCHIVE}", ) + +load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") + +# This sets up some common toolchains for building targets. For more details, please see +# https://bazelbuild.github.io/rules_foreign_cc/${TAG}/flatten.html#rules_foreign_cc_dependencies +rules_foreign_cc_dependencies() EOF -# TODO: add example of how to configure for both bzlmod and WORKSPACE +# TODO: add example of how to configure for bzlmod # awk 'f;/--SNIP--/{f=1}' e2e/smoke/WORKSPACE.bazel echo "\`\`\`"