Skip to content

Commit

Permalink
Instructions for git_override in release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthab committed Sep 19, 2023
1 parent 3e6d4d9 commit 5a276de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/release_notes_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ If you're using `bzlmod`, add the following to `MODULE.bazel`:
```starlark
bazel_dep(name = "toolchains_llvm", version = "{tag}")

# To directly use a commit from GitHub, replace commit with the commit you want.
# Otherwise, omit this block.
git_override(
module_name = "toolchains_llvm",
commit = "{commit}",
remote = "https://github.com/grailbio/bazel-toolchain",
)

# Configure and register the toolchain.
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
llvm.toolchain(
llvm_version = "16.0.0",
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ git config user.name "Your Name"

# Set by GH actions, see
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
tag=${GITHUB_REF_NAME}
tag="${GITHUB_REF_NAME}"
commit="${GITHUB_SHA}"
# The prefix is chosen to match what GitHub generates for source archives
prefix="toolchains_llvm-${tag}"
archive="toolchains_llvm-${tag}.tar.gz"
Expand All @@ -17,6 +18,7 @@ sha=$(shasum -a 256 "${archive}" | cut -f1 -d' ')

sed \
-e "s/{tag}/${tag}/g" \
-e "s/{commit}/${commit}/g" \
-e "s/{prefix}/${prefix}/g" \
-e "s/{archive}/${archive}/g" \
-e "s/{sha}/${sha}/g" \
Expand Down

0 comments on commit 5a276de

Please sign in to comment.