From 7652e998fbdc2cb2b867e0d870805f98952c00a0 Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Sat, 27 Apr 2024 10:54:22 +0900 Subject: [PATCH 1/2] Refresh CI setup: test against newer Rubies, use official actions --- .github/workflows/test.yml | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eeeda5a..11006b8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 From 8dfa8e7fb2ebec47d656fb0e757d5c69a1557612 Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Sat, 27 Apr 2024 11:03:07 +0900 Subject: [PATCH 2/2] Switch to RubyGems Trusted publishing in CI release workflow --- .github/workflows/build-release.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index c8e4d05..f7b1cb0 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -1,4 +1,4 @@ -name: Build and release gem to RubyGems +name: Build and release gem on: push: @@ -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: | @@ -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