Skip to content

Commit 6f2ddcb

Browse files
authored
build(release): update release process for bzlmod (#346)
Updates the pre-generated release notes to be bzlmod friendly, and adds a note about submitting to the Bazel Central Registry. Based on the process I ended up using for v0.29.0
1 parent 0f15b47 commit 6f2ddcb

File tree

3 files changed

+19
-28
lines changed

3 files changed

+19
-28
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# Cut a release whenever a new tag is pushed to the repo.
2-
# You should use an annotated tag, like `git tag -a v1.2.3`
3-
# and put the release notes into the commit message for the tag.
1+
# This action cuts a GitHub release whenever a new tag is pushed to the repo.
2+
# See CONTRIBUTING.md for a releasing guide.
43
name: Release
54

65
on:

.github/workflows/release_prep.sh

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,25 @@
11
#!/usr/bin/env bash
22
set -eufo pipefail
33

4+
# Called by .github/workflows/release.yml to generate release notes.
5+
46
# Set by GH actions, see
57
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
6-
TAG=${GITHUB_REF_NAME}
8+
TAG=${GITHUB_REF_NAME} # e.g. v1.2.3
9+
VERSION=${TAG#v} # e.g. 1.2.3
710
# The prefix is chosen to match what GitHub generates for source archives
811
PREFIX="rules_jvm-${TAG:1}"
912
ARCHIVE="rules_jvm-$TAG.tar.gz"
10-
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE
11-
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
12-
13-
cat << EOF
14-
WORKSPACE snippet:
15-
\`\`\`starlark
16-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
17-
http_archive(
18-
name = "contrib_rules_jvm",
19-
sha256 = "${SHA}",
20-
strip_prefix = "${PREFIX}",
21-
url = "https://github.com/bazel-contrib/rules_jvm/releases/download/${TAG}/${ARCHIVE}",
22-
)
13+
git archive --format=tar --prefix="${PREFIX}/" "${TAG}" | gzip >"$ARCHIVE"
2314

24-
# Fetches the contrib_rules_jvm dependencies.
25-
# If you want to have a different version of some dependency,
26-
# you should fetch it *before* calling this.
27-
load("@contrib_rules_jvm//:repositories.bzl", "contrib_rules_jvm_deps")
15+
cat <<EOF
16+
\`contrib_rules_jvm\` only supports \`bzlmod\`-enabled builds
2817
29-
contrib_rules_jvm_deps()
18+
## Module setup
3019
31-
# Now ensure that the downloaded deps are properly configured
32-
load("@contrib_rules_jvm//:setup.bzl", "contrib_rules_jvm_setup")
20+
In your \`MODULE.bazel\`:
3321
34-
contrib_rules_jvm_setup()
22+
\`\`\`starlark
23+
bazel_dep(name = "contrib_rules_jvm", version = "${VERSION}")
3524
\`\`\`
3625
EOF

CONTRIBUTING.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ point to the `rules_jvm` folder.
2828

2929
## Releasing
3030

31-
1. Determine the next release version, following semver if possible/
32-
2. Tag the repo and push it (or create a tag in GH UI).
33-
3. Watch the automation run on GitHub actions.
31+
1. Determine the next release version, following semver if possible.
32+
2. Tag the repo and push it (e.g. `git tag v1.2.3`), or create a tag in GitHub UI.
33+
3. Watch the automation run via the [GitHub action](.github/workflows/release.yml).
34+
4. Once the GitHub release has been created, you can manually edit it.
35+
5. Update the Bazel Central Registry's contrib_rules_jvm module, as in [this PR][]
3436

37+
[this PR]: https://github.com/bazelbuild/bazel-central-registry/pull/3770

0 commit comments

Comments
 (0)