Update release_prep.sh

Fix TAG name
This commit is contained in:
James Sharpe 2023-10-25 22:46:56 +01:00 committed by GitHub
parent fa1d617e5e
commit 3a85c822bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -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 "\`\`\`"