Skip to content

Commit

Permalink
build(rules_task): Include workspace snippet in release notes (#586)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvgijssel authored Oct 24, 2023
1 parent ef963ff commit 716ad9f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
20 changes: 12 additions & 8 deletions rules/rules_task/.releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,25 @@
"releaseRules": [
{
"type": "docs",
"scope": "readme.md",
"release": "patch"
},
{
"type": "build",
"release": "patch"
}
],
"preset": "conventionalcommits"
}
],
[
"@semantic-release/exec",
{
"generateNotesCmd": "./generate-release-notes.sh ${nextRelease.version}"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
Expand Down Expand Up @@ -76,13 +87,6 @@
}
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec",
{
"prepareCmd": "./prepare-release.sh ${nextRelease.version}"
}
],
[
"@semantic-release/github",
{
Expand Down
29 changes: 29 additions & 0 deletions rules/rules_task/generate-release-notes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash

set -Eeou pipefail

export VERSION="v$1"

export PREFIX="rules_task-$VERSION"
export ARCHIVE="rules_task-$VERSION.tar.gz"

git archive --format=tar --prefix=${PREFIX}/ HEAD | gzip > $ARCHIVE

export SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')

cat << EOF
## Using WORKSPACE:
\`\`\`starlark
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_task",
sha256 = "${SHA}",
strip_prefix = "${PREFIX}",
url = "https://github.com/vgijssel/setup/releases/download/${PREFIX}/${ARCHIVE}",
)
EOF

echo "\`\`\`"
9 changes: 0 additions & 9 deletions rules/rules_task/prepare-release.sh

This file was deleted.

0 comments on commit 716ad9f

Please sign in to comment.