Skip to content

Commit

Permalink
Fix release notes template tag. (#393)
Browse files Browse the repository at this point in the history
The existing release notes template block can't be pasted into a
MODULE.bazel because it generates an invalid semver. Strip the leading
"v".
  • Loading branch information
sputt authored Sep 30, 2024
1 parent 6d42ca3 commit 6edc43b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/release_notes_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@ Minimum bazel version: **7.0.0**
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/bazel-contrib/toolchains_llvm",
)
bazel_dep(name = "toolchains_llvm", version = "{version}")

# Configure and register the toolchain.
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
Expand All @@ -25,6 +17,15 @@ use_repo(llvm, "llvm_toolchain")
register_toolchains("@llvm_toolchain//:all")
```

To directly use a commit from GitHub, add this block and replace commit with the commit you want.
```starlark
git_override(
module_name = "toolchains_llvm",
commit = "{commit}",
remote = "https://github.com/bazel-contrib/toolchains_llvm",
)
```

If not using `bzlmod`, include this section in your `WORKSPACE`:

```starlark
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ sed -i.bak "s/0.0.0/${tag}/" MODULE.bazel && git add MODULE.bazel && git commit
git archive --format=tar --prefix="${prefix}/" HEAD | gzip >"${archive}"
sha=$(shasum -a 256 "${archive}" | cut -f1 -d' ')

# Strip leading "v" from the tag if present to create the semver version.
sed \
-e "s/{version}/${tag#v}/g" \
-e "s/{tag}/${tag}/g" \
-e "s/{commit}/${commit}/g" \
-e "s/{prefix}/${prefix}/g" \
Expand Down

0 comments on commit 6edc43b

Please sign in to comment.