diff --git a/.github/workflows/gem-push.yml b/.github/workflows/gem-push.yml index 7f78f3f..42bd67b 100644 --- a/.github/workflows/gem-push.yml +++ b/.github/workflows/gem-push.yml @@ -2,7 +2,7 @@ name: Ruby Gem on: push: - tags: [ 'v*.*.*' ] + tags: ["v*.*.*"] jobs: build: @@ -13,31 +13,31 @@ jobs: packages: write steps: - - uses: actions/checkout@v2 - - name: Set up Ruby 2.7 - uses: actions/setup-ruby@v1 - with: - ruby-version: 2.7.x + - uses: actions/checkout@v2 + - name: Set up Ruby 3.1 + uses: actions/setup-ruby@v1 + with: + ruby-version: 3.1.x - - name: Publish to GPR - run: | - mkdir -p $HOME/.gem - touch $HOME/.gem/credentials - chmod 0600 $HOME/.gem/credentials - printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - gem build *.gemspec - gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem - env: - GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}" - OWNER: ${{ github.repository_owner }} + - name: Publish to GPR + run: | + mkdir -p $HOME/.gem + touch $HOME/.gem/credentials + chmod 0600 $HOME/.gem/credentials + printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials + gem build *.gemspec + gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem + env: + GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}" + OWNER: ${{ github.repository_owner }} - - name: Publish to RubyGems - run: | - mkdir -p $HOME/.gem - touch $HOME/.gem/credentials - chmod 0600 $HOME/.gem/credentials - printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials - gem build *.gemspec - gem push *.gem - env: - GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" + - name: Publish to RubyGems + run: | + mkdir -p $HOME/.gem + touch $HOME/.gem/credentials + chmod 0600 $HOME/.gem/credentials + printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials + gem build *.gemspec + gem push *.gem + env: + GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 8ec16e2..a91fc09 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -10,15 +10,14 @@ name: Ruby on: push: pull_request: - branches: [ main ] + branches: [main] jobs: test: - runs-on: ubuntu-latest strategy: matrix: - ruby-version: ["2.7", "3.0", "3.1", "3.2", "3.3"] + ruby-version: ["3.1", "3.2", "3.3"] allow-failure: [false] include: - ruby-version: "ruby-head" @@ -26,16 +25,16 @@ jobs: continue-on-error: ${{ matrix.allow-failure }} steps: - - name: Checkout 🛎 - uses: actions/checkout@v2 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true - - name: Run tests - run: bundle exec rake - - name: Run codacy-coverage-reporter 📈 - uses: codacy/codacy-coverage-reporter-action@v1 - with: + - name: Checkout 🛎 + uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - name: Run tests + run: bundle exec rake + - name: Run codacy-coverage-reporter 📈 + uses: codacy/codacy-coverage-reporter-action@v1 + with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} diff --git a/.rubocop.yml b/.rubocop.yml index f5c7a7c..8858d04 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,6 @@ AllCops: - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.1 + NewCops: enable Metrics/AbcSize: Enabled: false Metrics/CyclomaticComplexity: diff --git a/edits.gemspec b/edits.gemspec index f160021..e56df1b 100644 --- a/edits.gemspec +++ b/edits.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.7" + spec.required_ruby_version = ">= 3.1" spec.add_development_dependency "benchmark-ips", "~> 2.8" spec.add_development_dependency "bundler", "~> 2.0"