Skip to content

Commit

Permalink
use the correct versions to regen the japicmp files (#6451)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkwatson authored May 10, 2024
1 parent 2b5ac31 commit 8d85b58
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/generate-post-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@ jobs:
- name: Set environment variables
run: |
version=$(.github/scripts/get-version.sh)
if [[ $version =~ ^([0-9]+)\.([0-9]+)\.0$ ]]; then
echo "VERSION=$version" >> $GITHUB_ENV
prior_version=$(.github/scripts/get-prior-version.sh)
echo "PRIOR_VERSION=$prior_version" >> $GITHUB_ENV
if [[ $prior_version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
next_version="$major.$((minor + 1)).0"
patch="${BASH_REMATCH[3]}"
two_releases_ago="$major.$((minor - 1)).$patch"
else
echo "unexpected version: $version"
echo "unexpected prior version: $prior_version"
exit 1
fi
echo "NEXT_VERSION=$next_version" >> $GITHUB_ENV
echo "VERSION=$version" >> $GITHUB_ENV
prior_version=$(.github/scripts/get-prior-version.sh)
echo "PRIOR_VERSION=$prior_version" >> $GITHUB_ENV
echo "TWO_VERSIONS_AGO=$two_releases_ago" >> $GITHUB_ENV
- name: Use CLA approved github bot
run: .github/scripts/use-cla-approved-github-bot.sh

Expand All @@ -51,13 +52,13 @@ jobs:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
run: |
./gradlew updateVersionInDocs -Prelease.version=$VERSION
./gradlew japicmp -PapiBaseVersion=$PRIOR_VERSION -PapiNewVersion=$VERSION
./gradlew updateVersionInDocs -Prelease.version=$PRIOR_VERSION
./gradlew japicmp -PapiBaseVersion=$TWO_VERSIONS_AGO -PapiNewVersion=$PRIOR_VERSION
./gradlew --refresh-dependencies japicmp
message="Post release for version $VERSION"
body="Post-release updates for version \`$VERSION\`."
branch="opentelemetrybot/post-release-for-${VERSION}"
message="Post release for version $PRIOR_VERSION"
body="Post-release updates for version \`$PRIOR_VERSION\`."
branch="opentelemetrybot/post-release-for-${PRIOR_VERSION}"

git checkout -b $branch
git commit -a -m "$message"
Expand Down

0 comments on commit 8d85b58

Please sign in to comment.