-
Notifications
You must be signed in to change notification settings - Fork 223
Generate the changelog for the beta releases #1363
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,40 @@ | ||
| #!/bin/bash | ||
|
|
||
| RELEASE_VERSION="$1" | ||
|
|
||
| # Delete until the first line containing "--" | ||
| sed -i '1,/--/d' temp_change.md | ||
| # Reverse the order of lines in the file (last line becomes first, etc.) | ||
| sed -i '1h;1d;$!H;$!d;G' temp_change.md | ||
| # Convert "**Full Changelog**: URL" format to markdown link format "[Full Changelog](URL)" | ||
| sed -i -re 's/\*\*Full Changelog\*\*: (.*)/\[Full Changelog\]\(\1\)\n/' temp_change.md | ||
| # Delete everything from "## New Contributors" line to the end of file | ||
| sed -i '/## New Contributors/,$d' temp_change.md | ||
| # Convert GitHub changelog entries from "* description by @username in pull/URL/number" | ||
| # to "- description [#number](pull/URL/number) ([username](https://github.com/username))" format | ||
| sed -i -re 's/^\*(.*)\sby\s@(.*)\sin\s(.*\/pull\/)(.*)/-\1 [\\#\4](\3\4) ([\2](https:\/\/github.com\/\2))/' temp_change.md | ||
| # Username substitutions for preferred display names | ||
| sed -i 's/\[Quotae/\[Quote_a/' temp_change.md | ||
| sed -i 's/\[learn2draw/\[Lexy/' temp_change.md | ||
| sed -i 's/\[Voronoff/\[Tom Clancy Is Dead/' temp_change.md | ||
| sed -i 's/\[PJacek/\[TPlant/' temp_change.md | ||
| sed -i 's/\[justjuangui/\[trompetin17/' temp_change.md | ||
|
|
||
| cp temp_change.md changelog_temp.txt | ||
| # Append existing CHANGELOG.md content (excluding first line) to temp_change.md | ||
| sed '1d' CHANGELOG.md >> temp_change.md | ||
| # Create new CHANGELOG.md with header containing version and date, followed by processed changes | ||
| printf "# Changelog\n\n## [$RELEASE_VERSION](https://github.com/PathOfBuildingCommunity/PathOfBuilding-PoE2/tree/$RELEASE_VERSION) ($(date +'%Y/%m/%d'))\n\n" | cat - temp_change.md > CHANGELOG.md | ||
| # Convert changelog entries from markdown link format to simplified "* description (username)" format | ||
| sed -i -re 's/^- (.*) \[.*\) \(\[(.*)\]\(.*/* \1 (\2)/' changelog_temp.txt | ||
| # Create new changelog format: add version header, remove lines 2-3, format section headers, remove ## headers with following line, prepend to existing changelog | ||
| echo "VERSION[${RELEASE_VERSION#v}][$(date +'%Y/%m/%d')]" | cat - changelog_temp.txt | sed '2,3d' | sed -re 's/^### (.*)/\n--- \1 ---/' | sed -e '/^##.*/,+1 d' | cat - changelog.txt > changelog_new.txt | ||
| mv changelog_new.txt changelog.txt | ||
|
|
||
| # Normalize line endings to CRLF for all output files to ensure consistent checksums with Windows | ||
| sed 's/\r*$/\r/' CHANGELOG.md > CHANGELOG_normalized.md && mv CHANGELOG_normalized.md CHANGELOG.md | ||
| sed 's/\r*$/\r/' changelog.txt > changelog_normalized.txt && mv changelog_normalized.txt changelog.txt | ||
|
|
||
| # Clean up temporary files | ||
| rm temp_change.md | ||
| rm changelog_temp.txt |
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
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
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.
I approved this initially because the release notes themselves look fine, but I think you need to append a hash (or just replace "beta" with the hash) here. When a user hits "Update" in PoB, it only shows the release notes up until the version they already have. Since they will already have "beta", the change log window will look blank. You can test this on your repo by just doing a couple of beta releases (with notes) and updating your PoB from each one
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.
On my last test, it actually showed the full changelog, because in the manifest the version is something like 0.x.y-hash and in the changelog, it's beta. So since it cannot find the same version, it shows everything. I think it's better than the current way where it shows nothing but there is definitely room for improvement. Imo, this can be improved 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.
That's only true for the first update, because the next one will be updating beta->beta and will show nothing again. I can't test it for a while to be sure, this is just from looking at the code. If you do a second update in your fork it should show what I mean (or prove me wrong, which is just as good)
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.
The manifest is updated in another step of the workflow (https://github.com/PathOfBuildingCommunity/PathOfBuilding-PoE2/pull/1363/files#diff-2c779738744716c38feb61cd6164d1d45a2a8d59615a1b867dec46ae7bfd9a44R26), and you can check on the beta release commit Musholic@8034986 (if you load the diff for the manifest file).
"beta" here is only to display it in the changelog, and having "beta" makes the urls actually work correctly since this is the name of an actual branch.
Note that updating the version in the manifest is optional, but I thought it would be interesting to be able to see which beta version someone is running from a screenshot. I can work on a quick fix to at least display the whole beta changelog instead of the whole changelog
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.
I didn't remember that the version comes from the manifest when comparing. With that fact, this PR seems good, we can iterate on it later if things need to change