diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ebc2dc..2dc7e7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: # We only care about rubocop against the latest ruby - ruby: ['3.2.2'] + ruby: ['3.4.4'] steps: - name: Checkout the code @@ -42,7 +42,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7.8', '3.0.6', '3.1.4', '3.2.2'] + ruby: ['3.2.8', '3.3.8', '3.4.4'] steps: - name: Checkout the code 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/.rubocop.yml b/.rubocop.yml index ec66fe0..b6488ff 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,2 +1,8 @@ inherit_gem: ezcater_rubocop: conf/rubocop_gem.yml + +plugins: + - rubocop-capybara + +AllCops: + TargetRubyVersion: 3.2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ba34dc..d6eb540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # required_env_fetcher +## v0.x.x +- Remove support for < Ruby 3.2 +- Switch to using RubyGems trusted publishing instead of manual releases + ## v0.1.0 - Initial version diff --git a/README.md b/README.md index 2a9a374..8603952 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,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 diff --git a/required_env_fetcher.gemspec b/required_env_fetcher.gemspec index b8fe864..5ca47ad 100644 --- a/required_env_fetcher.gemspec +++ b/required_env_fetcher.gemspec @@ -49,12 +49,12 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] # This is to match inherited settings from ezcater_rubocop which we # should probably update in a separate PR - spec.required_ruby_version = ">= 2.6" + spec.required_ruby_version = ">= 3.2" - spec.add_development_dependency "bundler", "~> 2.4.19" + spec.add_development_dependency "bundler", "~> 2.6.9" spec.add_development_dependency "climate_control" - spec.add_development_dependency "ezcater_rubocop", "~> 6.0.2" + spec.add_development_dependency "ezcater_rubocop", "~> 9.0.0" spec.add_development_dependency "overcommit" spec.add_development_dependency "rake", "~> 13.0.6" spec.add_development_dependency "rspec", "~> 3.4"