Skip to content

Commit 01edff6

Browse files
committed
streamline release also
1 parent e679c4f commit 01edff6

File tree

2 files changed

+83
-73
lines changed

2 files changed

+83
-73
lines changed

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

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

.github/workflows/release.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
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
@@ -114,4 +115,86 @@ jobs:
114115
--notes-file /tmp/release-notes.txt \
115116
v$VERSION
116117
118+
# these are used as job outputs
117119
echo "version=$VERSION" >> $GITHUB_OUTPUT
120+
echo "prior-version=$PRIOR_VERSION" >> $GITHUB_OUTPUT
121+
122+
update-apidiff-baseline-to-released-version:
123+
permissions:
124+
contents: write # for git push to PR branch
125+
runs-on: ubuntu-latest
126+
needs:
127+
- release
128+
steps:
129+
# add change log sync (if any) into this PR since the apidiff update
130+
# is required before any other PR can be merged anyway
131+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
132+
133+
- name: Copy change log section from release branch
134+
env:
135+
VERSION: ${{ needs.release.outputs.version }}
136+
run: |
137+
sed -n "0,/^## Version $VERSION /d;/^## Version /q;p" CHANGELOG.md \
138+
> /tmp/changelog-section.md
139+
140+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
141+
with:
142+
ref: main
143+
144+
- name: Merge change log to main
145+
env:
146+
VERSION: ${{ needs.release.outputs.version }}
147+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148+
run: |
149+
release_date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//')
150+
RELEASE_DATE=$release_date .github/scripts/merge-change-log-after-release.sh
151+
git add CHANGELOG.md
152+
153+
- name: Wait for release to be available in maven central
154+
env:
155+
VERSION: ${{ needs.release.outputs.version }}
156+
run: |
157+
until curl --silent \
158+
--show-error \
159+
--output /dev/null \
160+
--head \
161+
--fail \
162+
https://repo1.maven.org/maven2/io/opentelemetry/semconv/opentelemetry-semconv/$VERSION/opentelemetry-semconv-$VERSION.jar
163+
do
164+
sleep 60
165+
done
166+
167+
- name: Update apidiff baseline
168+
env:
169+
VERSION: ${{ needs.release.outputs.version }}
170+
PRIOR_VERSION: ${{ needs.release.outputs.prior-version }}
171+
run: |
172+
./gradlew japicmp -PapiBaseVersion=$PRIOR_VERSION -PapiNewVersion=$VERSION
173+
./gradlew --refresh-dependencies japicmp
174+
git add docs/apidiffs
175+
176+
- name: Use CLA approved bot
177+
run: .github/scripts/use-cla-approved-bot.sh
178+
179+
- uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
180+
id: otelbot-token
181+
with:
182+
app-id: ${{ vars.OTELBOT_APP_ID }}
183+
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
184+
185+
- name: Create pull request against main
186+
env:
187+
VERSION: ${{ needs.release.outputs.version }}
188+
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
189+
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
190+
run: |
191+
message="Update apidiff baseline to released version $VERSION"
192+
body="Update apidiff baseline to released version \`$VERSION\`."
193+
branch="otelbot/update-apidiff-baseline-to-released-version-${VERSION}"
194+
195+
git checkout -b $branch
196+
git commit -m "$message"
197+
git push --set-upstream origin $branch
198+
gh pr create --title "$message" \
199+
--body "$body" \
200+
--base main

0 commit comments

Comments
 (0)