Improve release workflow (#13518)
This commit is contained in:
parent
76dc8aa8f9
commit
943fecb49d
|
@ -188,13 +188,15 @@ jobs:
|
|||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
echo "prior-version=$PRIOR_VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
merge-change-log-to-main:
|
||||
update-apidiff-baseline-to-released-version:
|
||||
permissions:
|
||||
contents: write # for git push to PR branch
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- release
|
||||
steps:
|
||||
# add change log sync (if any) into this PR since the apidiff update
|
||||
# is required before any other PR can be merged anyway
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Copy change log section from release branch
|
||||
|
@ -216,53 +218,6 @@ jobs:
|
|||
release_date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//')
|
||||
RELEASE_DATE=$release_date .github/scripts/merge-change-log-after-release.sh
|
||||
|
||||
- name: Use CLA approved bot
|
||||
run: .github/scripts/use-cla-approved-bot.sh
|
||||
|
||||
- uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
|
||||
id: otelbot-token
|
||||
with:
|
||||
app-id: ${{ vars.OTELBOT_APP_ID }}
|
||||
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}
|
||||
|
||||
- name: Create pull request against main
|
||||
env:
|
||||
VERSION: ${{ needs.release.outputs.version }}
|
||||
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
|
||||
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
|
||||
run: |
|
||||
if git diff --quiet; then
|
||||
if [[ $VERSION == *.0 ]]; then
|
||||
echo there are no updates to merge, not creating pull request
|
||||
exit 0 # success
|
||||
else
|
||||
echo patch release notes did not get applied for some reason
|
||||
exit 1 # failure
|
||||
fi
|
||||
fi
|
||||
|
||||
message="Merge change log updates from $GITHUB_REF_NAME"
|
||||
body="Merge change log updates from \`$GITHUB_REF_NAME\`."
|
||||
branch="otelbot/merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
|
||||
|
||||
git checkout -b $branch
|
||||
git commit -a -m "$message"
|
||||
git push --set-upstream origin $branch
|
||||
gh pr create --title "$message" \
|
||||
--body "$body" \
|
||||
--base main
|
||||
|
||||
update-apidiff-baseline-to-released-version:
|
||||
permissions:
|
||||
contents: write # for git push to PR branch
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- release
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: main
|
||||
|
||||
- name: Wait for release to be available in maven central
|
||||
env:
|
||||
VERSION: ${{ needs.release.outputs.version }}
|
||||
|
|
Loading…
Reference in New Issue