From f5c1d54fe3eb2395aafe176797bfb4ec05242509 Mon Sep 17 00:00:00 2001 From: Jon-Erik Schneiderhan Date: Wed, 11 Jun 2025 10:00:53 -0400 Subject: [PATCH 1/6] Adds GitHub Action to release to RubyGems --- .github/workflows/release.yml | 23 +++++++++++++++++++++++ README.md | 8 +++++--- 2 files changed, 28 insertions(+), 3 deletions(-) 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..dc3588d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Release Gem +on: workflow_dispatch + +jobs: + push: + name: Push gem to RubyGems.org + runs-on: ubuntu-latest + + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag + + steps: + # Set up + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: ruby + + # Release + - uses: rubygems/release-gem@v1 diff --git a/README.md b/README.md index 71be130..997f5e8 100644 --- a/README.md +++ b/README.md @@ -94,9 +94,11 @@ interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. -To release a new version, update the version number in `version.rb`, and then -run `bundle exec rake release`, which will create a git tag for the version, -push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). +To release a new version, first ensure that the CHANGELOG.md and `version.rb` files are updated. In the +GitHub UI for this repository, navigate to `Actions -> Release Gem` and click `Run workflow`. Select +the branch you intend to release (most likely `main`). The action will create and push a git tag then +release the new version to Rubygems.org using the [trusted publishing](https://guides.rubygems.org/trusted-publishing/) +feature. ## Contributing From c0a13588ba6512e51df420044fdbba31e341ea61 Mon Sep 17 00:00:00 2001 From: Jon-Erik Schneiderhan Date: Thu, 12 Jun 2025 10:42:03 -0400 Subject: [PATCH 2/6] Upgrade Rubocop The previous version was failing in CI. Upgrading and adding the plugin line gets the Rubocop check passing again. --- .rubocop.yml | 3 +++ activerecord-postgres_pub_sub.gemspec | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index a95a9c2..ae49901 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,9 @@ inherit_gem: ezcater_rubocop: conf/rubocop_gem.yml +plugins: + - rubocop-capybara + AllCops: TargetRubyVersion: 3.0 SuggestExtensions: false diff --git a/activerecord-postgres_pub_sub.gemspec b/activerecord-postgres_pub_sub.gemspec index 15162d7..af294cf 100644 --- a/activerecord-postgres_pub_sub.gemspec +++ b/activerecord-postgres_pub_sub.gemspec @@ -45,7 +45,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler", "~> 2.2" spec.add_development_dependency "database_cleaner" spec.add_development_dependency "ezcater_matchers" - spec.add_development_dependency "ezcater_rubocop", "~> 6.1.0" + spec.add_development_dependency "ezcater_rubocop", "~> 9.0.0" spec.add_development_dependency "overcommit" spec.add_development_dependency "rake", "~> 13.1" spec.add_development_dependency "rspec", "~> 3.4" From 0a64dfc6c991cb690e653dc21caa4dbf09d7143d Mon Sep 17 00:00:00 2001 From: Jon-Erik Schneiderhan Date: Thu, 12 Jun 2025 10:44:06 -0400 Subject: [PATCH 3/6] Update ruby version constraint to 3.1 --- activerecord-postgres_pub_sub.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord-postgres_pub_sub.gemspec b/activerecord-postgres_pub_sub.gemspec index af294cf..38de7be 100644 --- a/activerecord-postgres_pub_sub.gemspec +++ b/activerecord-postgres_pub_sub.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.bindir = "bin" spec.executables = [] spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 3.0.0" + spec.required_ruby_version = ">= 3.1.0" spec.add_runtime_dependency "activerecord", "> 6.0", "< 8.1" spec.add_runtime_dependency "pg", "~> 1.1" From f5c0b6d72ea0a5d6eabec2cf8a34ebaccc6279b4 Mon Sep 17 00:00:00 2001 From: Jon-Erik Schneiderhan Date: Thu, 12 Jun 2025 10:46:33 -0400 Subject: [PATCH 4/6] Update ruby constraint to 3.2 Ruby 3.0 and 3.1 are both EOL. Ruby 3.2 is the lowest currently supported ruby version. --- .github/workflows/ci.yml | 10 ++-------- activerecord-postgres_pub_sub.gemspec | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87492eb..0b32458 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [ '3.0' ] + ruby: [ '3.2' ] steps: - name: Checkout the code @@ -38,18 +38,12 @@ jobs: fail-fast: false matrix: activerecord: [ '6.1', '7.0', '7.1', '7.2', '8.0' ] - ruby: [ '3.0', '3.1', '3.2', '3.3', '3.4' ] + ruby: [ '3.2', '3.3', '3.4' ] exclude: - activerecord: '6.1' ruby: '3.4' - activerecord: '7.0' ruby: '3.4' - - activerecord: '7.2' - ruby: '3.0' - - activerecord: '8.0' - ruby: '3.0' - - activerecord: '8.0' - ruby: '3.1' timeout-minutes: 10 needs: - lint diff --git a/activerecord-postgres_pub_sub.gemspec b/activerecord-postgres_pub_sub.gemspec index 38de7be..76efbaa 100644 --- a/activerecord-postgres_pub_sub.gemspec +++ b/activerecord-postgres_pub_sub.gemspec @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| spec.bindir = "bin" spec.executables = [] spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 3.1.0" + spec.required_ruby_version = ">= 3.2.0" spec.add_runtime_dependency "activerecord", "> 6.0", "< 8.1" spec.add_runtime_dependency "pg", "~> 1.1" From 74bf609c66ab544ecfe540711bd67aff82ea3ca9 Mon Sep 17 00:00:00 2001 From: Jon-Erik Schneiderhan Date: Thu, 12 Jun 2025 10:48:48 -0400 Subject: [PATCH 5/6] Missed a version declaration --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index ae49901..84a7b28 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ plugins: - rubocop-capybara AllCops: - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.2 SuggestExtensions: false Naming/FileName: From 03373f871078030f90f622a9985e776213c3e302 Mon Sep 17 00:00:00 2001 From: Jon-Erik Schneiderhan Date: Fri, 13 Jun 2025 10:09:38 -0400 Subject: [PATCH 6/6] Version bump to 3.3.0 --- CHANGELOG.md | 4 ++++ lib/activerecord/postgres_pub_sub/version.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1ec6db..9cef534 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # activerecord-postgres_pub_sub +## v3.3.0 +- Remove support for Ruby 3.0 and 3.1 +- Switch to using RubyGems trusted publishing instead of manual releases + ## v3.2.0 - Add support for ActiveRecord 8.0 - Add support for Ruby 3.4 diff --git a/lib/activerecord/postgres_pub_sub/version.rb b/lib/activerecord/postgres_pub_sub/version.rb index 5ec5a49..72b61b7 100644 --- a/lib/activerecord/postgres_pub_sub/version.rb +++ b/lib/activerecord/postgres_pub_sub/version.rb @@ -2,6 +2,6 @@ module ActiveRecord module PostgresPubSub - VERSION = "3.2.0" + VERSION = "3.3.0" end end