Workflow updates (#6027)

This commit is contained in:
Trask Stalnaker 2022-05-16 01:59:30 -07:00 committed by GitHub
parent 18367e72a0
commit 59e47a2865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 10 deletions

View File

@ -1,8 +1,8 @@
#!/bin/bash -e
version=$(grep -Eo "[0-9]+.[0-9]+.0" version.gradle.kts)
version=$("$(dirname "$0")/get-version.sh")
if [[ $version =~ ([0-9]+).([0-9]+).0 ]]; then
if [[ $version =~ ([0-9]+)\.([0-9]+)\.0 ]]; then
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
else
@ -12,14 +12,19 @@ fi
if [[ $minor == 0 ]]; then
prior_major=$((major - 1))
prior_minor=$(grep -Po "^## Version $prior_major.\K([0-9]+)" CHANGELOG.md | head -1)
prior_version="$prior_major.$prior_minor"
prior_minor=$(sed -n "s/^## Version $prior_major\.\([0-9]\+\)\..*/\1/p" CHANGELOG.md | head -1)
if [[ -z $prior_minor ]]; then
# assuming this is the first release
range=
else
range="v$prior_major.$prior_minor.0..HEAD"
fi
else
prior_version="$major.$((minor - 1)).0"
range="v$major.$((minor - 1)).0..HEAD"
fi
echo "## Version $version (Unreleased)"
echo
git log --reverse --pretty=format:"- %s" "v$prior_version"..HEAD \
| sed -r 's,\(#([0-9]+)\),\n ([#\1](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/\1)),'
git log --reverse --pretty=format:"- %s" $range \
| sed -E 's,\(#([0-9]+)\),\n ([#\1](https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/\1)),'

View File

@ -1,3 +1,3 @@
#!/bin/bash -e
grep -Eo "[0-9]+.[0-9]+.0" version.gradle.kts
grep -Po "val stableVersion = \"\K[0-9]+.[0-9]+.0" version.gradle.kts

View File

@ -25,7 +25,7 @@ jobs:
- name: Update download link version
run: |
version=$(grep -Eo "[0-9]+.[0-9]+.0" version.gradle.kts)
version=$(.github/scripts/get-version.sh)
sed -Ei "s,https://github\.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/,https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$version/," README.md
- name: Set git user

View File

@ -90,7 +90,7 @@ jobs:
if [[ $patch == 0 ]]; then
if [[ $minor == 0 ]]; then
prior_major=$((major - 1))
prior_minor=$(grep -Po "^## Version $prior_major.\K([0-9]+)" CHANGELOG.md | head -1)
prior_minor=$(grep -Po "^## Version $prior_major.\K[0-9]+" CHANGELOG.md | head -1)
prior_version="$prior_major.$prior_minor"
else
prior_version="$major.$((minor - 1)).0"