From 9d2c134680ad3e76c23e72494b0254ca2b0656e7 Mon Sep 17 00:00:00 2001 From: kvokka-agent Date: Sun, 23 Aug 2026 18:45:17 +0000 Subject: [PATCH 1/3] feat: drop Rails 7.x and refresh the supported version matrix Rails 7.1 went EoL on 2025-10-01 and 7.2 on 2026-08-09, Ruby 3.2 on 2026-03-31. What is left is Rails / ActiveRecord 8.0 and 8.1 on Ruby 3.3, 3.4 and 4.0, which lets sqlite3 sit at 2.x in every Gemfile. Ruby 4.0 dropped rdoc from the default gems, so the Rakefile's RDoc task made `rake` fail on the activerecord-only gemfiles; RubyGems.org builds the published documentation itself. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/ruby.yml | 6 +----- Appraisals | 26 -------------------------- Gemfile | 4 ++-- README.md | 8 ++++---- Rakefile | 10 ---------- gemfiles/activerecord_7_1.gemfile | 17 ----------------- gemfiles/activerecord_7_2.gemfile | 17 ----------------- gemfiles/rails_7_1.gemfile | 16 ---------------- gemfiles/rails_7_2.gemfile | 16 ---------------- pp_sql.gemspec | 4 ++-- 10 files changed, 9 insertions(+), 115 deletions(-) delete mode 100644 gemfiles/activerecord_7_1.gemfile delete mode 100644 gemfiles/activerecord_7_2.gemfile delete mode 100644 gemfiles/rails_7_1.gemfile delete mode 100644 gemfiles/rails_7_2.gemfile diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 12a43a2..4532ca8 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -15,14 +15,10 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ['3.2', '3.3', '3.4'] + ruby-version: ['3.3', '3.4', '4.0'] gemfile: - - gemfiles/rails_7_1.gemfile - - gemfiles/rails_7_2.gemfile - gemfiles/rails_8_0.gemfile - gemfiles/rails_8_1.gemfile - - gemfiles/activerecord_7_1.gemfile - - gemfiles/activerecord_7_2.gemfile - gemfiles/activerecord_8_0.gemfile - gemfiles/activerecord_8_1.gemfile diff --git a/Appraisals b/Appraisals index 4854914..fc6626e 100644 --- a/Appraisals +++ b/Appraisals @@ -7,18 +7,6 @@ skip_gems_snippet = <<~GEMS end GEMS -appraise 'rails-7-1' do - gem 'rails', '~> 7.1.0' - gem 'sqlite3', '~> 2.0' - eval(skip_gems_snippet) -end - -appraise 'rails-7-2' do - gem 'rails', '~> 7.2.0' - gem 'sqlite3', '~> 2.0' - eval(skip_gems_snippet) -end - appraise 'rails-8-0' do gem 'rails', '~> 8.0.0' gem 'sqlite3', '~> 2.0' @@ -31,20 +19,6 @@ appraise 'rails-8-1' do eval(skip_gems_snippet) end -appraise 'activerecord-7-1' do - gem 'activerecord', '~> 7.1.0' - gem 'rake' - gem 'sqlite3', '~> 2.0' - eval(skip_gems_snippet) -end - -appraise 'activerecord-7-2' do - gem 'activerecord', '~> 7.2.0' - gem 'rake' - gem 'sqlite3', '~> 2.0' - eval(skip_gems_snippet) -end - appraise 'activerecord-8-0' do gem 'activerecord', '~> 8.0.0' gem 'rake' diff --git a/Gemfile b/Gemfile index 6e8abb6..348e3cd 100644 --- a/Gemfile +++ b/Gemfile @@ -25,8 +25,8 @@ group :local_development do gem 'appraisal' gem 'overcommit' gem 'pry' - gem 'rails', '>= 7.1' + gem 'rails', '>= 8.0' gem 'reek' gem 'rubocop', '~> 1.85' - gem 'sqlite3', '>= 1.4' + gem 'sqlite3', '~> 2.0' end diff --git a/README.md b/README.md index 27f48d8..e126ca2 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ Or in console ## Require -Ruby 3.1+ +Ruby 3.3+ ## Rails -Rails / ActiveRecord 7.1+ (optional), will be injected automatically +Rails / ActiveRecord 8.0+ (optional), will be injected automatically ## Legacy @@ -102,8 +102,8 @@ bundle exec appraisal install bundle exec appraisal rake ``` -GitHub Actions runs the Rails / ActiveRecord `7.1`, `7.2`, `8.0`, and `8.1` -matrix on Ruby `3.2`, `3.3`, and `3.4`. +GitHub Actions runs the Rails / ActiveRecord `8.0` and `8.1` matrix on +Ruby `3.3`, `3.4`, and `4.0`. ## License diff --git a/Rakefile b/Rakefile index bdd8df3..afbdd85 100644 --- a/Rakefile +++ b/Rakefile @@ -7,16 +7,6 @@ rescue LoadError puts 'You must `gem install bundler` and `bundle install` to run rake tasks' end -require 'rdoc/task' - -RDoc::Task.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'PpSql' - rdoc.options << '--line-numbers' - rdoc.rdoc_files.include('README.md') - rdoc.rdoc_files.include('lib/**/*.rb') -end - require 'bundler/gem_tasks' require 'rake/testtask' diff --git a/gemfiles/activerecord_7_1.gemfile b/gemfiles/activerecord_7_1.gemfile deleted file mode 100644 index fdd1ddf..0000000 --- a/gemfiles/activerecord_7_1.gemfile +++ /dev/null @@ -1,17 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "minitest" -gem "minitest-focus" -gem "minitest-reporters" -gem "tzinfo-data" -gem "activerecord", "~> 7.1.0" -gem "rake" -gem "sqlite3", "~> 2.0" - -group :local_development do - -end - -gemspec path: "../" diff --git a/gemfiles/activerecord_7_2.gemfile b/gemfiles/activerecord_7_2.gemfile deleted file mode 100644 index 5731deb..0000000 --- a/gemfiles/activerecord_7_2.gemfile +++ /dev/null @@ -1,17 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "minitest" -gem "minitest-focus" -gem "minitest-reporters" -gem "tzinfo-data" -gem "activerecord", "~> 7.2.0" -gem "rake" -gem "sqlite3", "~> 2.0" - -group :local_development do - -end - -gemspec path: "../" diff --git a/gemfiles/rails_7_1.gemfile b/gemfiles/rails_7_1.gemfile deleted file mode 100644 index 5e88cd9..0000000 --- a/gemfiles/rails_7_1.gemfile +++ /dev/null @@ -1,16 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "minitest" -gem "minitest-focus" -gem "minitest-reporters" -gem "tzinfo-data" -gem "rails", "~> 7.1.0" -gem "sqlite3", "~> 2.0" - -group :local_development do - -end - -gemspec path: "../" diff --git a/gemfiles/rails_7_2.gemfile b/gemfiles/rails_7_2.gemfile deleted file mode 100644 index aeab389..0000000 --- a/gemfiles/rails_7_2.gemfile +++ /dev/null @@ -1,16 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "minitest" -gem "minitest-focus" -gem "minitest-reporters" -gem "tzinfo-data" -gem "rails", "~> 7.2.0" -gem "sqlite3", "~> 2.0" - -group :local_development do - -end - -gemspec path: "../" diff --git a/pp_sql.gemspec b/pp_sql.gemspec index 350693b..a43cd5b 100644 --- a/pp_sql.gemspec +++ b/pp_sql.gemspec @@ -18,9 +18,9 @@ Gem::Specification.new do |s| s.files = Dir['lib/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md'] - s.required_ruby_version = '>= 3.1.0' + s.required_ruby_version = '>= 3.3.0' - s.add_dependency 'activerecord' + s.add_dependency 'activerecord', '>= 8.0' s.add_dependency 'anbt-sql-formatter', '~> 0.1.0' s.metadata['rubygems_mfa_required'] = 'true' From b202741670a29c9048edddb0f818ba260a288e6c Mon Sep 17 00:00:00 2001 From: kvokka-agent Date: Sun, 23 Aug 2026 18:45:17 +0000 Subject: [PATCH 2/3] ci: publish the gem to RubyGems.org from a version tag Pushing a `v*` tag builds the gem, pushes it and cuts the GitHub release. The push authenticates through RubyGems trusted publishing, so the repository holds no API key and the gem keeps `rubygems_mfa_required`. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ README.md | 13 +++++++++++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cbd9251 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Release + +on: + push: + tags: ["v*"] + +permissions: + contents: read + +jobs: + push: + name: Push the gem to RubyGems.org + runs-on: ubuntu-latest + permissions: + contents: write # create the GitHub release + id-token: write # mint the RubyGems trusted publishing token + + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.4' + - name: Check the tag against PpSql::VERSION + run: | + version="v$(ruby -Ilib -rpp_sql/version -e 'print PpSql::VERSION')" + if [ "$version" != "$GITHUB_REF_NAME" ]; then + echo "tag $GITHUB_REF_NAME does not match PpSql::VERSION ($version)" >&2 + exit 1 + fi + - name: Build the gem + run: gem build pp_sql.gemspec + # Exchanges the Actions OIDC token for a short lived RubyGems token, so + # the push carries no API key and satisfies rubygems_mfa_required. + - name: Configure RubyGems credentials + uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a # v2.1.0 + - name: Push the gem + run: gem push pp_sql-*.gem + - name: Create the GitHub release + env: + GH_TOKEN: ${{ github.token }} + run: gh release create "$GITHUB_REF_NAME" --generate-notes pp_sql-*.gem diff --git a/README.md b/README.md index e126ca2..a79d61c 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,19 @@ bundle exec appraisal rake GitHub Actions runs the Rails / ActiveRecord `8.0` and `8.1` matrix on Ruby `3.3`, `3.4`, and `4.0`. +## Releasing + +Bump `PpSql::VERSION`, merge it, then push the matching tag: + +```bash +git tag v2.3.0 +git push origin v2.3.0 +``` + +The `Release` workflow checks the tag against `PpSql::VERSION`, builds the gem, +pushes it to RubyGems.org through trusted publishing and creates the GitHub +release. + ## License The gem is available as open source under the terms of the From 014f3da326cdb333cdf74dbda50ba8585f79ebf8 Mon Sep 17 00:00:00 2001 From: kvokka-agent Date: Sun, 23 Aug 2026 18:45:17 +0000 Subject: [PATCH 3/3] chore: release 2.3.0 Co-Authored-By: Claude Opus 5 (1M context) --- lib/pp_sql/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pp_sql/version.rb b/lib/pp_sql/version.rb index 94aefc9..bec1a1b 100644 --- a/lib/pp_sql/version.rb +++ b/lib/pp_sql/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module PpSql - VERSION = '2.2.0' + VERSION = '2.3.0' end