1212 runs-on : ubuntu-24.04
1313 outputs :
1414 version : ${{ steps.create-github-release.outputs.version }}
15+ prior-version : ${{ steps.create-github-release.outputs.prior-version }}
1516 steps :
1617 - run : |
1718 if [[ $GITHUB_REF_NAME != release/* ]]; then
@@ -128,15 +129,19 @@ jobs:
128129 --notes-file /tmp/release-notes.txt \
129130 v$VERSION
130131
132+ # these are used as job outputs
131133 echo "version=$VERSION" >> $GITHUB_OUTPUT
134+ echo "prior-version=$PRIOR_VERSION" >> $GITHUB_OUTPUT
132135
133- merge-change-log -to-main :
136+ update-apidiff-baseline -to-released-version :
134137 permissions :
135138 contents : write # for git push to PR branch
136139 runs-on : ubuntu-latest
137140 needs :
138141 - release
139142 steps :
143+ # add change log sync (if any) into this PR since the apidiff update
144+ # is required before any other PR can be merged anyway
140145 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
141146
142147 - name : Copy change log section from release branch
@@ -157,32 +162,52 @@ jobs:
157162 run : |
158163 release_date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//')
159164 RELEASE_DATE=$release_date .github/scripts/merge-change-log-after-release.sh
165+ git add CHANGELOG.md
160166
161- - name : Use CLA approved github bot
162- run : .github/scripts/use-cla-approved-github-bot.sh
167+ - name : Wait for release to be available in maven central
168+ env :
169+ VERSION : ${{ needs.release.outputs.version }}
170+ run : |
171+ until curl --silent \
172+ --show-error \
173+ --output /dev/null \
174+ --head \
175+ --fail \
176+ https://repo1.maven.org/maven2/io/opentelemetry/opentelemetry-api/$VERSION/opentelemetry-api-$VERSION.jar
177+ do
178+ sleep 60
179+ done
180+
181+ - name : Update apidiff baseline
182+ env :
183+ VERSION : ${{ needs.release.outputs.version }}
184+ PRIOR_VERSION : ${{ needs.release.outputs.prior-version }}
185+ run : |
186+ ./gradlew japicmp -PapiBaseVersion=$PRIOR_VERSION -PapiNewVersion=$VERSION
187+ ./gradlew --refresh-dependencies japicmp
188+ git add docs/apidiffs
189+
190+ - name : Use CLA approved bot
191+ run : .github/scripts/use-cla-approved-bot.sh
192+
193+ - uses : actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
194+ id : otelbot-token
195+ with :
196+ app-id : ${{ vars.OTELBOT_APP_ID }}
197+ private-key : ${{ secrets.OTELBOT_PRIVATE_KEY }}
163198
164199 - name : Create pull request against main
165200 env :
166201 VERSION : ${{ needs.release.outputs.version }}
167202 # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
168- GH_TOKEN : ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
203+ GH_TOKEN : ${{ steps.otelbot-token.outputs.token }}
169204 run : |
170- if git diff --quiet; then
171- if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.0 ]]; then
172- echo there are no updates to merge, not creating pull request
173- exit 0 # success
174- else
175- echo patch release notes did not get applied for some reason
176- exit 1 # failure
177- fi
178- fi
179-
180- message="Merge change log updates from $GITHUB_REF_NAME"
181- body="Merge log updates from \`$GITHUB_REF_NAME\`."
182- branch="opentelemetrybot/merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
205+ message="Update apidiff baseline to released version $VERSION"
206+ body="Update apidiff baseline to released version \`$VERSION\`."
207+ branch="otelbot/update-apidiff-baseline-to-released-version-${VERSION}"
183208
184209 git checkout -b $branch
185- git commit -a - m "$message"
210+ git commit -m "$message"
186211 git push --set-upstream origin $branch
187212 gh pr create --title "$message" \
188213 --body "$body" \
0 commit comments