diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20e526b..03ca12e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,9 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7.8 + rubygems: latest - name: Cache gem dependencies uses: actions/cache@v1 diff --git a/.ruby-version b/.ruby-version index 944880f..6a81b4c 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.0 +2.7.8 diff --git a/Gemfile.lock b/Gemfile.lock index b9d5c64..171ebe5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,16 +12,17 @@ GIT PATH remote: . specs: - rspamd (0.1.0) + rspamd-ruby (1.0.0) GEM remote: https://rubygems.org/ specs: - activesupport (7.0.4.2) + activesupport (6.1.7.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) + zeitwerk (~> 2.3) addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) ast (2.4.2) @@ -67,7 +68,7 @@ GEM rubocop-performance (1.16.0) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.17.4) + rubocop-rails (2.19.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) @@ -80,6 +81,7 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) + zeitwerk (2.6.8) PLATFORMS ruby @@ -88,9 +90,9 @@ DEPENDENCIES debug minitest (> 5.11) rake (~> 13.0) - rspamd! + rspamd-ruby! rubocop-37signals! webmock (~> 3.0) BUNDLED WITH - 2.1.4 + 2.4.17 diff --git a/bin/release b/bin/release new file mode 100755 index 0000000..e11b31a --- /dev/null +++ b/bin/release @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +VERSION=$1 + +printf "module Rspamd\n VERSION = \"$VERSION\"\nend\n" > ./lib/rspamd/version.rb +bundle +git add Gemfile.lock lib/rspamd/version.rb +git commit -m "Bump version for $VERSION" +git push +git tag v$VERSION +git push --tags +gem build rspamd-ruby.gemspec +gem push "rspamd-ruby-$VERSION.gem" --host https://rubygems.org +rm "rspamd-ruby-$VERSION.gem" diff --git a/lib/rspamd.rb b/lib/rspamd-ruby.rb similarity index 100% rename from lib/rspamd.rb rename to lib/rspamd-ruby.rb diff --git a/lib/rspamd/version.rb b/lib/rspamd/version.rb new file mode 100644 index 0000000..9e076b7 --- /dev/null +++ b/lib/rspamd/version.rb @@ -0,0 +1,3 @@ +module Rspamd + VERSION = "1.0.0" +end diff --git a/rspamd.gemspec b/rspamd-ruby.gemspec similarity index 65% rename from rspamd.gemspec rename to rspamd-ruby.gemspec index 6523df4..e7074f3 100644 --- a/rspamd.gemspec +++ b/rspamd-ruby.gemspec @@ -1,12 +1,14 @@ +require_relative "lib/rspamd/version" + Gem::Specification.new do |s| - s.name = "rspamd" - s.version = "0.1.0" - s.authors = "George Claghorn" - s.email = "george@basecamp.com" + s.name = "rspamd-ruby" + s.version = Rspamd::VERSION + s.authors = [ "George Claghorn", "Lewis Buckley" ] + s.email = "lewis@37signals.com" s.summary = "Client for Rspamd's HTTP API" s.homepage = "https://github.com/basecamp/rspamd-ruby" - s.required_ruby_version = ">= 2.6.0" + s.required_ruby_version = ">= 2.7.8" s.add_development_dependency "rake", "~> 13.0" s.add_development_dependency "minitest", "> 5.11" diff --git a/test/test_helper.rb b/test/test_helper.rb index 79f50c9..af5ca9c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,4 +1,4 @@ require "minitest/autorun" require "webmock/minitest" -require "rspamd" +require "rspamd-ruby" require "debug"