diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f68dd5b..12cfa07e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,15 +12,14 @@ on: jobs: test: - strategy: matrix: os: [ubuntu-latest] ruby-version: - - '3.0' - - '3.1' - - '3.2' - - '3.3' + - "3.0" + - "3.1" + - "3.2" + - "3.3" runs-on: ${{ matrix.os }} @@ -32,4 +31,4 @@ jobs: ruby-version: ${{ matrix.ruby-version }} bundler-cache: true - name: Run tests for Ruby ${{ matrix.ruby-version }} on ${{ matrix.os }} - run: bundle config unset deployment && bundle exec rake + run: bundle config unset deployment && ./bin/rake diff --git a/bin/rake b/bin/rake new file mode 100755 index 00000000..4eb7d7bf --- /dev/null +++ b/bin/rake @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rake' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rake", "rake") diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 879124a7..8fc047c8 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -15,13 +15,13 @@ rake install:local # Build and install standard-x.x.x.gem into system gems wi rake release[remote] # Create tag vx.x.x and build and push standard-0.5.2.gem to rubygems.org ``` -Most of these commands are depended on (read: run by) `rake release`, which is +Most of these commands are depended on (read: run by) `./bin/rake release`, which is really the only one we'll need for releasing the gem to [Rubygems.org](https://rubygems.org/gems/standard). ## Release steps -1. Make sure git is up to date and `bundle exec rake` exits cleanly +1. Make sure git is up to date and `./bin/rake` exits cleanly 1. If you upgraded a Rubocop dependency, be sure to lock it down in `standard.gemspec`. To avoid being broken transitively, we stick to exact release dependencies (e.g. "0.91.0" instead of "~> 0.91") @@ -34,9 +34,8 @@ really the only one we'll need for releasing the gem to 1. Run `bundle` so that Bundler writes this version to `Gemfile.lock` 1. Commit `lib/standard/version.rb`, `Gemfile.lock`, and `CHANGELOG.md` together with the message equal to the new version (e.g. "0.42.1") -1. Finally, run `bundle exec rake release`, which will hopefully succeed +1. Finally, run `./bin/rake release`, which will hopefully succeed 1. Provide your multi-factor-auth token when prompted to finish publishing the gem 1. [Tweet](https://twitter.com) about your awesome new release! (Shameless self-promotion is the most important part of open source software) - diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 251e8879..0c1e210f 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -11,21 +11,21 @@ The official standard plug-ins that are included in standard are: 1. Update Rubocop plugin in the gemspec file and gem file. 1. Keep standard in the gem file up-to-date. This will bring any testing utilities in standard into the plug-in repository. -1. Run bundle exec rake to run the tests +1. Run `./bin/rake` to run the tests 1. Configure any cops that need to be configured so that the tests pass 1. Update the change log to the best of your ability and title it as unreleased 1. Make your commit for these updates and push to the main branch 1. Update the version in version.rb and update the version in the Changelog replacing the word “Unreleased” 1. Run bundle to write the new version number to the lock file -1. Run bundle exec release to release the gem to RubyGems and create the version git tag. Push the tag to GitHub. +1. Run `./bin/rake release` to release the gem to RubyGems and create the version git tag. Push the tag to GitHub. ## Updating Standard 1. Update Rubocop as well as Standard Performance in the gemspec file and gem file. -1. Run bundle exec rake to run the tests +1. Run `./bin/rake` to run the tests 1. Configure any cops that need to be configured so that the tests pass 1. Update the change log to the best of your ability and title it as unreleased 1. Make your commit for these updates and push to the main branch 1. Update the version in version.rb and update the version in the Changelog replacing the word “Unreleased” 1. Run bundle to write the new version number to the lock file -1. Run bundle exec release to release the gem to RubyGems and create the version git tag. Push the tag to GitHub. +1. Run `./bin/rake` to release the gem to RubyGems and create the version git tag. Push the tag to GitHub.