-
Notifications
You must be signed in to change notification settings - Fork 408
Updating changelog when building releases #192
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
Conversation
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.
LGTM, if you like I suggested a change to make the sed -ing more robust
createReleaseTarball.sh
Outdated
| # UPDATE CHANGELOG.md # | ||
| ######################### | ||
| echo "[INFO] Updating version number in CHANGELOG.md to ${VERSION_WITHOUT_RC}..." | ||
| sed -i '' -e s/"# Unreleased"/"# v${VERSION_WITHOUT_RC}"/ CHANGELOG.md |
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.
This seems a bit fragile, What if "# Unreleased" appears anywhere else.
Also, it seems that the current version doesn't have a blank line in line number 2 .
What if it was deleted in the process.
I suggest,
- only sed-ing the first line,
- replace "# Unreleased" or ignore it and append if it isn't there
- append to the end of the first line so that anything non congruent stands out
s.t. like
sed -i '' -E '1 s/(# Unreleased|^)/# Unreleased'$'\\n\\n-\\n'"# v${VERSION_WITHOUT_RC}/" CHANGELOG.md
instead of lines 95-97
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.
Updated the sed command to only replace the first occurrence. Points 2 and 3 are hard to implement in a way that is compatible with both Linux and Mac. So I'm keeping the simple cat to file, and move solution for now.
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.
My only worry is that if someone accidentally changes that first line, the version will not be added.
How about replacing the first "# Unreleased" with nothing ("") and adding the v$VERSION_WITHOUT_RC in the echo in the next line ?
No description provided.