-
Notifications
You must be signed in to change notification settings - Fork 30
Add missing post-release script #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,44 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| # this script merges release notes for $VERSION into CHANGELOG.md | ||
| # the release date for $VERSION should be available in $RELEASE_DATE | ||
| # and the release notes for $VERSION should be available in /tmp/changelog-section.md | ||
|
|
||
| if [[ $VERSION =~ ^[0-9]+\.[0-9]+\.0 ]]; then | ||
| # this was not a patch release, so the version exists already in the CHANGELOG.md | ||
|
|
||
| # update the release date | ||
| sed -Ei "s/## Version $VERSION .*/## Version $VERSION ($RELEASE_DATE)/" CHANGELOG.md | ||
|
|
||
| # the entries are copied over from the release branch to support workflows | ||
| # where change log entries may be updated after preparing the release branch | ||
|
|
||
| { | ||
| # copy the portion above the release, up to and including the heading | ||
| sed -n "0,/^## Version $VERSION /p" CHANGELOG.md | ||
| # copy the release notes for $VERSION | ||
| cat /tmp/changelog-section.md | ||
| # copy the portion below the release | ||
| sed -n "0,/^## Version $VERSION /d;0,/^## Version /{/^## Version/!d};p" CHANGELOG.md | ||
| } > /tmp/CHANGELOG.md | ||
|
|
||
| # update the real CHANGELOG.md | ||
| cp /tmp/CHANGELOG.md CHANGELOG.md | ||
|
|
||
| else | ||
| # this was a patch release, so the version does not exist already in the CHANGELOG.md | ||
|
|
||
| { | ||
| # copy the portion above the top-most release, not including the heading | ||
| sed -n "0,/^## Version /{ /^## Version /!p }" CHANGELOG.md | ||
| # add the heading | ||
| echo "## Version $VERSION ($RELEASE_DATE)" | ||
| # copy the release notes for $VERSION | ||
| cat /tmp/changelog-section.md | ||
| # copy the portion starting from the top-most release | ||
| sed -n "/^## Version /,\$p" CHANGELOG.md | ||
| } > /tmp/CHANGELOG.md | ||
|
|
||
| # update the real CHANGELOG.md | ||
| cp /tmp/CHANGELOG.md CHANGELOG.md | ||
| fi | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this could be factored out of the if/else and just exist after.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at this point I'd prefer to keep these files in sync since they're in multiple repos