Skip to content

Commit 45cf9b0

Browse files
authored
Add script to help draft change log (#296)
* Add script to help draft change log * updates
1 parent ee9a7a6 commit 45cf9b0

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash -e
2+
3+
version=$(grep -Eo "[0-9]+.[0-9]+.0" version.gradle.kts)
4+
5+
if [[ $version =~ ([0-9]+).([0-9]+).0 ]]; then
6+
major="${BASH_REMATCH[1]}"
7+
minor="${BASH_REMATCH[2]}"
8+
else
9+
echo "unexpected version: $version"
10+
exit 1
11+
fi
12+
13+
if [[ $minor == 0 ]]; then
14+
prior_major=$((major - 1))
15+
prior_minor=$(grep -Po "^## Version $prior_major.\K([0-9]+)" CHANGELOG.md | head -1)
16+
prior_version="$prior_major.$prior_minor"
17+
else
18+
prior_version="$major.$((minor - 1)).0"
19+
fi
20+
21+
git log --reverse --pretty=format:"- %s" "v$prior_version"..HEAD \
22+
| sed -r 's,\(#([0-9]+)\),\n ([#\1](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/\1)),'

RELEASING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ as the last step, which publishes a snapshot build to
1616
* Merge a pull request to `main` updating the `CHANGELOG.md`.
1717
* The heading for the release should include the release version but not the release date, e.g.
1818
`## Version 1.9.0 (unreleased)`.
19+
* Use `.github/scripts/draft-change-log-entries.sh` as a starting point for writing the change
20+
log.
1921
* Run the [Prepare release branch workflow](.github/workflows/prepare-release-branch.yml).
2022
* Review and merge the two pull requests that it creates
2123
(one is targeted to the release branch and one is targeted to the `main` branch).

0 commit comments

Comments
 (0)