Skip to content

Commit 67afa5b

Browse files
committed
Add release prep script
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
1 parent b34b04f commit 67afa5b

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/release_prep.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit -o nounset -o pipefail
4+
5+
# Argument provided by reusable workflow caller, see
6+
# https://github.com/bazel-contrib/.github/blob/d197a6427c5435ac22e56e33340dff912bc9334e/.github/workflows/release_ruleset.yaml#L72
7+
TAG=$1
8+
9+
PREFIX="rules_vulkan-${TAG:1}"
10+
ARCHIVE="rules_vulkan-$TAG.tar.gz"
11+
12+
# NB: configuration for 'git archive' is in /.gitattributes
13+
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE
14+
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
15+
16+
cat << EOF
17+
## Using Bzlmod with Bazel 6 or greater
18+
19+
1. (Bazel 6 only) Enable with \`common --enable_bzlmod\` in \`.bazelrc\`.
20+
2. Add to your \`MODULE.bazel\` file:
21+
22+
\`\`\`starlark
23+
bazel_dep(name = "rules_vulkan", version = "${TAG:1}")
24+
\`\`\`
25+
26+
## Using WORKSPACE
27+
28+
Paste this snippet into your \`WORKSPACE.bazel\` file:
29+
30+
\`\`\`starlark
31+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
32+
http_archive(
33+
name = "com_myorg_rules_mylang",
34+
sha256 = "${SHA}",
35+
strip_prefix = "${PREFIX}",
36+
url = "https://github.com/mxpv/rules_vulkan/releases/download/${TAG}/${ARCHIVE}",
37+
)
38+
EOF
39+
40+
echo "\`\`\`"

0 commit comments

Comments
 (0)