Skip to content

Commit ef2f034

Browse files
authored
Automate post-release step (#12463)
1 parent 3c32c6a commit ef2f034

File tree

2 files changed

+55
-14
lines changed

2 files changed

+55
-14
lines changed

.github/workflows/release.yml

+52
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
- required-jobs
2222
outputs:
2323
version: ${{ steps.create-github-release.outputs.version }}
24+
prior-version: ${{ steps.create-github-release.outputs.prior-version }}
2425
steps:
2526
- run: |
2627
if [[ $GITHUB_REF_NAME != release/* ]]; then
@@ -177,6 +178,7 @@ jobs:
177178
opentelemetry-java-instrumentation-SBOM.zip
178179
179180
echo "version=$VERSION" >> $GITHUB_OUTPUT
181+
echo "prior-version=$PRIOR_VERSION" >> $GITHUB_OUTPUT
180182
181183
merge-change-log-to-main:
182184
runs-on: ubuntu-latest
@@ -233,3 +235,53 @@ jobs:
233235
gh pr create --title "$message" \
234236
--body "$body" \
235237
--base main
238+
239+
update-apidiff-baseline-to-released-version:
240+
runs-on: ubuntu-latest
241+
needs:
242+
- release
243+
steps:
244+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
245+
with:
246+
ref: main
247+
248+
- name: Use CLA approved github bot
249+
run: .github/scripts/use-cla-approved-github-bot.sh
250+
251+
- name: Wait for release to be available in maven central
252+
run: |
253+
until curl --silent \
254+
--show-error \
255+
--output /dev/null \
256+
--head \
257+
--fail \
258+
https://repo1.maven.org/maven2/io/opentelemetry/javaagent/opentelemetry-javaagent/$VERSION/opentelemetry-javaagent-$VERSION.jar
259+
do
260+
sleep 60
261+
done
262+
263+
- name: Update apidiff baseline
264+
env:
265+
VERSION: ${{ needs.release.outputs.version }}
266+
PRIOR_VERSION: ${{ needs.release.outputs.prior-version }}
267+
run: |
268+
./gradlew japicmp -PapiBaseVersion=$PRIOR_VERSION -PapiNewVersion=$VERSION
269+
./gradlew --refresh-dependencies japicmp
270+
271+
- name: Create pull request against main
272+
env:
273+
VERSION: ${{ needs.release.outputs.version }}
274+
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
275+
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
276+
run: |
277+
message="Update apidiff baseline to released version $VERSION"
278+
body="Update apidiff baseline to released version \`$version\`."
279+
branch="opentelemetrybot/update-apidiff-baseline-to-released-version-${VERSION}"
280+
281+
git checkout -b $branch
282+
git add docs/apidiffs
283+
git commit -m "$message"
284+
git push --set-upstream origin $branch
285+
gh pr create --title "$message" \
286+
--body "$body" \
287+
--base main

RELEASING.md

+3-14
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,13 @@ and deadlocks.
6565
e.g. `release/v1.9.x`, and click the "Run workflow" button below that.
6666
- This workflow will publish the artifacts to maven central and will publish a GitHub release
6767
with release notes based on the change log and with the javaagent jar attached.
68+
- Review and merge the pull request that it creates for updating the apidiff baseline version
69+
to the newly released version (note that this pull request won't be made until after the release
70+
is available in maven central).
6871
- Review and merge the pull request that it creates for updating the change log in main
6972
(note that if this is not a patch release then the change log on main may already be up-to-date,
7073
in which case no pull request will be created).
7174

72-
## Update release versions in documentations
73-
74-
After releasing is done, you need to first update the docs. This needs to happen after artifacts have propagated
75-
to Maven Central so should probably be done an hour or two after the release workflow finishes.
76-
77-
```sh
78-
./gradlew japicmp -PapiBaseVersion=a.b.c -PapiNewVersion=x.y.z
79-
./gradlew --refresh-dependencies japicmp
80-
```
81-
82-
Where `x.y.z` is the version just released and `a.b.c` is the previous version.
83-
84-
Create a PR to mark the new release in docs on the main branch.
85-
8675
## Credentials
8776

8877
Same as the core repo, see [opentelemetry-java/RELEASING.md#credentials](https://github.com/open-telemetry/opentelemetry-java/blob/main/RELEASING.md#credentials).

0 commit comments

Comments
 (0)