Skip to content

Commit

Permalink
Merge branch 'master' into measure-requests-count
Browse files Browse the repository at this point in the history
* master:
  Switch to RubyGems Trusted publishing in CI release workflow
  Refresh CI setup: test against newer Rubies, use official actions
  • Loading branch information
Envek committed Apr 27, 2024
2 parents f4ea597 + 8dfa8e7 commit f046c48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 28 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and release gem to RubyGems
name: Build and release gem

on:
push:
Expand All @@ -8,13 +8,17 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch current tag as annotated. See https://github.com/actions/checkout/issues/290
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: "3.3"
- name: "Extract data from tag: version, message, body"
id: tag
run: |
Expand Down Expand Up @@ -75,8 +79,8 @@ jobs:
GEM_HOST_API_KEY: Bearer ${{ secrets.GITHUB_TOKEN }}
run: |
gem push yabeda-puma-plugin-${{ steps.tag.outputs.version }}.gem --host https://rubygems.pkg.github.com/${{ github.repository_owner }}
- name: Configure RubyGems Credentials
uses: rubygems/configure-rubygems-credentials@main
- name: Publish to RubyGems
env:
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
run: |
gem push yabeda-puma-plugin-${{ steps.tag.outputs.version }}.gem
31 changes: 8 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,21 @@ jobs:
fail-fast: false
matrix:
include:
- ruby: "3.3"
puma: "6"
- ruby: "3.2"
puma: "6"
- ruby: "3.1"
puma: "6"
- ruby: "3.0"
puma: "5"
- ruby: "2.7"
puma: "5"
- ruby: "2.6"
puma: "4"
- ruby: "2.5"
puma: "4"
container:
image: ruby:${{ matrix.ruby }}
env:
CI: true
PUMA_VERSION: ${{ matrix.puma }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
path: vendor/bundle
key: bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
restore-keys: |
bundle-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}-${{ hashFiles('**/Gemfile') }}
bundle-${{ matrix.ruby }}-
- name: Upgrade Bundler to 2.0 (for older Rubies)
run: gem install bundler -v '~> 2.0'
- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install
bundle update
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run RSpec
run: bundle exec rspec

0 comments on commit f046c48

Please sign in to comment.