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
@@ -158,31 +163,50 @@ jobs:
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
160165
161- - name : Use CLA approved github bot
162- run : .github/scripts/use-cla-approved-github-bot.sh
166+ - name : Wait for release to be available in maven central
167+ env :
168+ VERSION : ${{ needs.release.outputs.version }}
169+ run : |
170+ until curl --silent \
171+ --show-error \
172+ --output /dev/null \
173+ --head \
174+ --fail \
175+ https://repo1.maven.org/maven2/io/opentelemetry/opentelemetry-api/$VERSION/opentelemetry-api-$VERSION.jar
176+ do
177+ sleep 60
178+ done
179+
180+ - name : Update apidiff baseline
181+ env :
182+ VERSION : ${{ needs.release.outputs.version }}
183+ PRIOR_VERSION : ${{ needs.release.outputs.prior-version }}
184+ run : |
185+ ./gradlew japicmp -PapiBaseVersion=$PRIOR_VERSION -PapiNewVersion=$VERSION
186+ ./gradlew --refresh-dependencies japicmp
187+
188+ - name : Use CLA approved bot
189+ run : .github/scripts/use-cla-approved-bot.sh
190+
191+ - uses : actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
192+ id : otelbot-token
193+ with :
194+ app-id : ${{ vars.OTELBOT_APP_ID }}
195+ private-key : ${{ secrets.OTELBOT_PRIVATE_KEY }}
163196
164197 - name : Create pull request against main
165198 env :
166199 VERSION : ${{ needs.release.outputs.version }}
167200 # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
168- GH_TOKEN : ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
201+ GH_TOKEN : ${{ steps.otelbot-token.outputs.token }}
169202 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//\//-}"
203+ message="Update apidiff baseline to released version $VERSION"
204+ body="Update apidiff baseline to released version \`$VERSION\`."
205+ branch="otelbot/update-apidiff-baseline-to-released-version-${VERSION}"
183206
184207 git checkout -b $branch
185- git commit -a -m "$message"
208+ git add docs/apidiffs
209+ git commit -m "$message"
186210 git push --set-upstream origin $branch
187211 gh pr create --title "$message" \
188212 --body "$body" \
0 commit comments