Skip to content

Commit 2cd0ab0

Browse files
jDramaixcopybara-github
authored andcommitted
Make j2cl/release_prep.sh repo agnostic so we can reuse it in all our repos.
PiperOrigin-RevId: 789049494
1 parent b21ca2a commit 2cd0ab0

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/workflows/release_prep.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@
55
set -euo pipefail
66

77
tag="$1"
8-
# The prefix is used to determine the directory structure of the archive. We strip the 'v'
9-
# prefix from the version number.
10-
directory="jsinterop-annotations-${tag#v}"
11-
archive="jsinterop-annotations-${tag}.tar.gz"
8+
# GITHUB_REPOSITORY looks like user/repository_name, let strip the user part.
9+
repository=${GITHUB_REPOSITORY#*/}
10+
# The prefix is used to determine the directory structure of the archive. We
11+
# strip the 'v'prefix from the version number.
12+
directory="${repository}-${tag#v}"
13+
archive="${repository}-${tag}.tar.gz"
1214

1315
git archive --format=tar --prefix=${directory}/ -o "${archive}" ${tag}
1416

15-
# The stdout of this program will be used as the top of the release notes for this release.
17+
# Replace hyphens with underscores in the repository name to match our Bazel
18+
# module naming conventions.
19+
bazel_module_name="${repository//-/_}"
20+
# The stdout of this program will be used as the top of the release notes for
21+
# this release.
1622
cat << EOF
1723
## Using Bazel 8 or later, add to your \`MODULE.bazel\` file:
1824
1925
\`\`\`starlark
20-
bazel_dep(name = "jsinterop_annotations", version = "${tag}")
26+
bazel_dep(name = "${bazel_module_name}", version = "${tag}")
2127
\`\`\`
22-
EOF
28+
EOF

0 commit comments

Comments
 (0)