Skip to content

Commit

Permalink
Add release and constraint info to changelog and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Nov 26, 2024
1 parent 35c761b commit e08b008
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ icon: versions-24

# CHANGELOG

## Release Policy

Pagy follows the [Semantic Versioning 2.0.0](https://semver.org/), and introduces BREAKING CHANGES only for MAYOR versions.

We release any new version (MAJOR, MINOR, PATCH) as soon as it is ready for release, regardless of any time constraint,
frequency or duration.

We rarely deprecate elements (releasing a new MAYOR version is just simpler and more efficient). However, when we do, you
can expect the old functionality to be supported ONLY during the next releases belonging to the same MAYOR version.

## Recommended Version Constraint

Given a version number `MAJOR.MINOR.PATCH` (e.g. `9.3.1`):

The `gem 'pagy', '~> 9.3'` Gemfile entry (without the PATCH number) ensures that the `bundle update` command will update pagy to
the most recent version WITHOUT BREAKING CHANGES.

Increment the MAYOR version indicated in the Gemfile ONLY when you are ready to handle the BREAKING CHANGES

## Breaking Changes

If you upgrade from version `< 9.0.0` see the following:
Expand Down
2 changes: 2 additions & 0 deletions scripts/bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@

# Update the CHANGELOG
replace_string_in_file('CHANGELOG.md', /<hr>\n/, "<hr>\n\n## Version #{new_version}\n\n#{changes}")
replace_string_in_file('CHANGELOG.md', "(e.g. `#{old_version}", "(e.g. `#{new_version}")
replace_string_in_file('CHANGELOG.md', *["~> #{old_version}", "~> #{new_version}"].map { |v| v.split('.')[0, 2].join('.') })

# Bump the version in files
(%w[retype.yml
Expand Down
5 changes: 4 additions & 1 deletion test/pagy/version_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
_(Pagy.root.join('javascripts', 'pagy.mjs').read).must_match "version: \"#{Pagy::VERSION}\","
end
it 'defines the same version in CHANGELOG.md' do
_(Pagy.root.parent.join('CHANGELOG.md').read).must_match "## Version #{Pagy::VERSION}"
changelog = Pagy.root.parent.join('CHANGELOG.md').read
_(changelog).must_match "(e.g. `#{Pagy::VERSION}"
_(changelog).must_match "gem 'pagy', '~> #{Pagy::VERSION.sub(/\.\d+$/, '')}"
_(changelog).must_match "## Version #{Pagy::VERSION}"
end
it 'defines the same minor version in ./quick-start.md' do
_(File.read('./quick-start.md')).must_match "gem 'pagy', '~> #{Pagy::VERSION.sub(/\.\d+$/, '')}"
Expand Down

0 comments on commit e08b008

Please sign in to comment.