-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release workflow improvement (#4353)
* heading format * Remove separators * workflow * updates * Include note about release heading * fix link
- Loading branch information
Showing
7 changed files
with
187 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Merge change log to main | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
create-pull-request: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
# history is needed to run format-patch below | ||
fetch-depth: 0 | ||
|
||
- name: Set git user | ||
run: | | ||
git config user.name opentelemetry-java-bot | ||
git config user.email [email protected] | ||
# this will fail if there have been conflicting change log updates introduced in main | ||
- name: Create pull request against main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git format-patch --stdout main..$GITHUB_REF_NAME CHANGELOG.md | git apply | ||
msg="Merge change log updates from $GITHUB_REF_NAME to main" | ||
git commit -a -m "$msg" | ||
git push origin HEAD:merge-change-log-updates-to-main | ||
gh pr create --title "$msg" \ | ||
--body "$msg" \ | ||
--head merge-change-log-updates-to-main \ | ||
--base main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ jobs: | |
git config user.name opentelemetry-java-bot | ||
git config user.email [email protected] | ||
- name: Create pull request against release branch | ||
- name: Create pull request against the release branch | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,31 +95,24 @@ jobs: | |
--discussion-category announcements \ | ||
v$VERSION | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
# history is needed in order to generate the patch | ||
fetch-depth: 0 | ||
- name: Update the change log with the release date | ||
run: | | ||
date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//') | ||
sed -ri "s/## Version $VERSION .*/## Version $VERSION ($date)/" CHANGELOG.md | ||
- name: Set git user | ||
run: | | ||
git config user.name opentelemetry-java-bot | ||
git config user.email [email protected] | ||
# this step should be last since it will fail if there have been conflicting | ||
# change log updates introduced on the main branch | ||
- name: Create pull request to merge any change log updates to main | ||
- name: Create pull request against the release branch | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git format-patch --stdout main..$GITHUB_REF_NAME CHANGELOG.md > patch | ||
if [ -s patch ]; then | ||
git apply patch | ||
msg="Merge change log updates from $GITHUB_REF_NAME to main" | ||
git commit -a -m "$msg" | ||
git push origin HEAD:merge-change-log-updates-to-main | ||
gh pr create --title "$msg" \ | ||
--body "$msg" \ | ||
--head merge-change-log-updates-to-main \ | ||
--base main | ||
fi | ||
msg="Add $VERSION release date to the change log" | ||
git commit -a -m "$msg" | ||
git push origin HEAD:add-$VERSION-release-date | ||
gh pr create --title "[$GITHUB_REF_NAME] $msg" \ | ||
--body "$msg" \ | ||
--head add-$VERSION-release-date \ | ||
--base $GITHUB_REF_NAME |
Oops, something went wrong.