Skip to content

Commit

Permalink
Ensure bump script copies also the "What's new" from README
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Jul 18, 2024
1 parent 46132a7 commit ae2cc69
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
6 changes: 2 additions & 4 deletions .github/latest_release_body.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
### ✴ What's new in 8.0+ ✴

<!-- whats_new_start -->
### ✴ What's new in 9.0+ ✴
- Wicked-fast [Keyset Pagination](https://ddnexus.github.io/pagy/docs/extras/keyset/) for big data! It works with `ActiveRecord::Relation` and `Sequel::Dataset` sets.
- Wicked-fast [Keyset Pagination](https://ddnexus.github.io/pagy/docs/api/keyset/) for big data! It works with `ActiveRecord::Relation` and `Sequel::Dataset` sets.
- More [Playground Apps](https://ddnexus.github.io/pagy/playground/) to showcase, clone and develop pagy APPs without any setup on your side
- Lots of refactorings and optimizations
- See the [Changelog](https://ddnexus.github.io/pagy/changelog) for possible breaking changes
<!-- whats_new_end -->
<!-- whats_new_end -->

### Changes in 8.6.3

Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ done... or use the detailed table below:

- The internal Pagy protected methods have been renamed and refactored. If you use custom Pagy
classes, you may need to search into the code.

<hr>

## Version 8.6.3

Temporary section to pass the tests
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
---
<!-- whats_new_start -->
### ✴ What's new in 9.0+ ✴
- Wicked-fast [Keyset Pagination](https://ddnexus.github.io/pagy/docs/extras/keyset/) for big data! It works with `ActiveRecord::Relation` and `Sequel::Dataset` sets.
- Wicked-fast [Keyset Pagination](https://ddnexus.github.io/pagy/docs/api/keyset/) for big data! It works with `ActiveRecord::Relation` and `Sequel::Dataset` sets.
- More [Playground Apps](https://ddnexus.github.io/pagy/playground/) to showcase, clone and develop pagy APPs without any setup on your side
- Lots of refactorings and optimizations
- See the [Changelog](https://ddnexus.github.io/pagy/changelog) for possible breaking changes
<!-- whats_new_end -->
<!-- whats_new_end -->
---

### πŸš€ πŸš€ πŸš€ πŸš€ πŸš€
Expand Down
17 changes: 13 additions & 4 deletions scripts/bump
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,20 @@ function edit_doc() {

edit_doc 'Commit log' "$tmplog"

# Insert the changes in the the release body file used by .github/workflows/create_release.yml
# which is triggered by the :rubygem_release task (push tag)
lead='^<!-- changes start -->$'
tail='^<!-- changes end -->$'
# Insert the whats_new (from README) and changes in the the release body file
# used by .github/workflows/create_release.yml which is triggered by the :rubygem_release task (push tag)
release_body_path="$root/.github/latest_release_body.md"
### What's New
lead='<!-- whats_new_start -->'
tail='<!-- whats_new_end -->'
#whats_new=$(sed -n "/$lead/,/$tail/p" "$root/README")
whats_new=$(sed -n "/$lead/,/$tail/{//b;p}" "$root/README.md")
gawk -i inplace -v st="$lead" -v et="$tail" -v repl="$whats_new" '
$0 == st{del=1} $0 == et{$0 = repl; del=0} !del' "$release_body_path"

### Changes
lead='^<!-- changes_start -->$'
tail='^<!-- changes_end -->$'
sed -i "/$lead/,/$tail/{ /$lead/{p; r $tmplog
}; /$tail/p; d }" "$release_body_path"

Expand Down

0 comments on commit ae2cc69

Please sign in to comment.