Skip to content

Commit 14e2fef

Browse files
authored
Switch to otelbot and streamline post release process (#7273)
1 parent ccfcecf commit 14e2fef

File tree

10 files changed

+89
-120
lines changed

10 files changed

+89
-120
lines changed

.github/repository-settings.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,12 @@ Repository settings in addition to what's documented already at
103103
- Key is associated with [@trask](https://github.com/trask)'s gmail address
104104
- `SONATYPE_KEY` - owned by [@jack-berg](https://github.com/jack-berg)
105105
- `SONATYPE_USER` - owned by [@jack-berg](https://github.com/jack-berg)
106+
107+
### Organization secrets
108+
109+
- `FOSSA_API_KEY`
110+
- `OTELBOT_PRIVATE_KEY`
111+
112+
### Organization variables
113+
114+
- `OTELBOT_APP_ID`

.github/scripts/generate-release-contributors.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,5 @@ echo $contributors1 $contributors2 \
8686
| grep -v github-actions \
8787
| grep -v renovate \
8888
| grep -v codecov \
89-
| grep -v opentelemetrybot \
89+
| grep -v otelbot \
9090
| sed 's/^/@/'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash -e
22

3-
git config user.name opentelemetrybot
4-
git config user.email 107717825+opentelemetrybot@users.noreply.github.com
3+
git config user.name otelbot
4+
git config user.email 197425009+otelbot@users.noreply.github.com

.github/workflows/backport.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,22 @@ jobs:
2929
- name: Use CLA approved github bot
3030
run: .github/scripts/use-cla-approved-github-bot.sh
3131

32+
- uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
33+
id: otelbot-token
34+
with:
35+
app-id: ${{ vars.OTELBOT_APP_ID }}
36+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
37+
3238
- name: Create pull request
3339
env:
3440
NUMBER: ${{ github.event.inputs.number }}
3541
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
36-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
42+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
3743
run: |
3844
commit=$(gh pr view $NUMBER --json mergeCommit --jq .mergeCommit.oid)
3945
title=$(gh pr view $NUMBER --json title --jq .title)
4046
41-
branch="opentelemetrybot/backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}"
47+
branch="otelbot/backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}"
4248
4349
git checkout -b $branch
4450
git cherry-pick $commit

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ jobs:
8282
RUN_JMH_BASED_TESTS: ${{ matrix.jmh-based-tests }}
8383

8484
- name: Check for diff
85-
# The jApiCmp diff compares current to latest, which isn't appropriate for release branches, or for bot-generated PRs
85+
# The jApiCmp diff compares current to latest, which isn't appropriate for release branches
8686
# this fails on windows because of the bash-specific if/then/else syntax, but that's ok
8787
# because we only need to run this validation once (on any platform)
88-
if: ${{ matrix.os != 'windows-latest' && !startsWith(github.ref_name, 'release/') && !startsWith(github.base_ref, 'release/') && (github.actor != 'opentelemetrybot') }}
88+
if: ${{ matrix.os != 'windows-latest' && !startsWith(github.ref_name, 'release/') && !startsWith(github.base_ref, 'release/') }}
8989
run: |
9090
# need to "git add" in case any generated files did not already exist
9191
git add docs/apidiffs

.github/workflows/generate-post-release-pr.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/prepare-patch-release.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,19 @@ jobs:
4747
- name: Use CLA approved github bot
4848
run: .github/scripts/use-cla-approved-github-bot.sh
4949

50+
- uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
51+
id: otelbot-token
52+
with:
53+
app-id: ${{ vars.OTELBOT_APP_ID }}
54+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
55+
5056
- name: Create pull request
5157
env:
5258
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
53-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
59+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
5460
run: |
5561
message="Prepare release $VERSION"
56-
branch="opentelemetrybot/prepare-release-${VERSION}"
62+
branch="otelbot/prepare-release-${VERSION}"
5763
5864
git checkout -b $branch
5965
git commit -a -m "$message"

.github/workflows/prepare-release-branch.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,19 @@ jobs:
5959
- name: Use CLA approved github bot
6060
run: .github/scripts/use-cla-approved-github-bot.sh
6161

62+
- uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
63+
id: otelbot-token
64+
with:
65+
app-id: ${{ vars.OTELBOT_APP_ID }}
66+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
67+
6268
- name: Create pull request against the release branch
6369
env:
6470
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
65-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
71+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
6672
run: |
6773
message="Prepare release $VERSION"
68-
branch="opentelemetrybot/prepare-release-${VERSION}"
74+
branch="otelbot/prepare-release-${VERSION}"
6975
7076
git checkout -b $branch
7177
git commit -a -m "$message"
@@ -109,14 +115,20 @@ jobs:
109115
- name: Use CLA approved github bot
110116
run: .github/scripts/use-cla-approved-github-bot.sh
111117

118+
- uses: actions/create-github-app-token@3ff1caaa28b64c9cc276ce0a02e2ff584f3900c5 # v2.0.2
119+
id: otelbot-token
120+
with:
121+
app-id: ${{ vars.OTELBOT_APP_ID }}
122+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
123+
112124
- name: Create pull request against main
113125
env:
114126
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
115-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
127+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
116128
run: |
117129
message="Update version to $NEXT_VERSION"
118130
body="Update version to \`$NEXT_VERSION\`."
119-
branch="opentelemetrybot/update-version-to-${NEXT_VERSION}"
131+
branch="otelbot/update-version-to-${NEXT_VERSION}"
120132
121133
git checkout -b $branch
122134
git commit -a -m "$message"

.github/workflows/release.yml

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
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" \

RELEASING.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,6 @@ and deadlocks.
6363
contains documentation on autoconfiguration properties. If the release has updated or modified any
6464
properties, open and merge a pull request to update the documentation.
6565

66-
## Update release versions in documentations
67-
68-
After releasing is done, you need to first update the docs. This needs to happen after artifacts have propagated
69-
to Maven Central so should probably be done an hour or two after the release workflow finishes.
70-
71-
```
72-
./gradlew updateVersionInDocs -Prelease.version=x.y.z
73-
./gradlew japicmp -PapiBaseVersion=a.b.c -PapiNewVersion=x.y.z
74-
./gradlew --refresh-dependencies japicmp
75-
```
76-
77-
Where `x.y.z` is the version just released and `a.b.c` is the previous version.
78-
79-
Create a PR against the main branch with the changes.
80-
8166
## Credentials
8267

8368
The following credentials are required for building or publishing (and automatically set in Github Actions):

0 commit comments

Comments
 (0)