From abb054af9c162ec414b5b41c13bc26b00c07f349 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 13 Jan 2025 02:44:30 -0800 Subject: [PATCH] ci: add/bump Ruby 3.4, move Node to 22 (#1594) This involves some explicit adding of gems that were moved out of the default gems: - `base64` and `csv` are needed for both Jekyll 3.9 and Jekyll 4.3 - `bigdecimal` is just needed for Jekyll 3.9 In the ideal case, this gets backported to both Jekyll 3.9 and 4.3 so we don't need custom Gemfiles. But, I'm also okay with adding these manually for now, and then reverting once both get a backport that patches this. Reminds me of webrick! --- .github/workflows/ci.yml | 8 +++---- .github/workflows/deploy.yml | 2 +- .github/workflows/publish-gem.yml | 35 +++++++++++++++---------------- Gemfile | 3 +++ Gemfile.lock | 16 ++++++++------ fixtures/Gemfile-jekyll-3.9 | 4 ++++ fixtures/Gemfile-jekyll-4.3 | 3 +++ 7 files changed, 42 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59b95f5..8f415f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: matrix: jekyll-version: [3.9, 4.3] os: [ubuntu-latest, macos-latest, windows-latest] - ruby-version: ["3.1", "3.2", "3.3"] + ruby-version: ["3.1", "3.2", "3.3", "3.4"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -46,7 +46,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: "3.3" + ruby-version: "3.4" bundler-cache: false - name: Bundle Install run: bundle install @@ -62,7 +62,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ["3.3"] + ruby-version: ["3.4"] runs-on: ubuntu-latest steps: @@ -96,7 +96,7 @@ jobs: strategy: matrix: - node-version: [20.x] + node-version: [22.x] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8379d13..fa617b0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -34,7 +34,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: "3.3" + ruby-version: "3.4" bundler-cache: true # runs 'bundle install' and caches installed gems automatically cache-version: 0 # Increment this number if you need to re-download cached gems - name: Setup Pages diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 7997196..ebed538 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -1,7 +1,6 @@ name: Publish Ruby Gem -on: - workflow_dispatch +on: workflow_dispatch jobs: build: @@ -9,23 +8,23 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Setup Ruby 3.3 - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.3" + - uses: actions/checkout@v4 + - name: Setup Ruby 3.4 + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" - - 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 }} # Disabled as this does not handle 2FA # - name: Publish to RubyGems diff --git a/Gemfile b/Gemfile index b4057b6..587b047 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,9 @@ source "https://rubygems.org" gemspec +gem "base64" +gem "csv" + gem "jekyll-github-metadata", ">= 2.15" gem "jekyll-include-cache", group: :jekyll_plugins diff --git a/Gemfile.lock b/Gemfile.lock index 7d60dcc..f3782e9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -19,6 +19,7 @@ GEM fiber-annotation io-event (~> 1.5, >= 1.5.1) timers (~> 4.1) + base64 (0.2.0) bigdecimal (3.1.8) colorator (1.1.0) concurrent-ruby (1.3.4) @@ -26,6 +27,7 @@ GEM fiber-annotation fiber-local (~> 1.1) json + csv (3.3.2) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) @@ -36,17 +38,17 @@ GEM faraday-net_http (>= 2.0, < 3.2) faraday-net_http (3.1.0) net-http - ffi (1.17.0-arm64-darwin) - ffi (1.17.0-x86_64-linux-gnu) + ffi (1.17.1-arm64-darwin) + ffi (1.17.1-x86_64-linux-gnu) fiber-annotation (0.2.0) fiber-local (1.1.0) fiber-storage fiber-storage (0.1.0) forwardable-extended (2.6.0) - google-protobuf (4.28.2-arm64-darwin) + google-protobuf (4.29.3-arm64-darwin) bigdecimal rake (>= 13) - google-protobuf (4.28.2-x86_64-linux) + google-protobuf (4.29.3-x86_64-linux) bigdecimal rake (>= 13) hashery (2.1.2) @@ -104,9 +106,9 @@ GEM mercenary (0.4.0) net-http (0.4.1) uri - nokogiri (1.16.5-arm64-darwin) + nokogiri (1.18.1-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.5-x86_64-linux) + nokogiri (1.18.1-x86_64-linux-gnu) racc (~> 1.4) octokit (6.1.1) faraday (>= 1, < 3) @@ -155,7 +157,9 @@ PLATFORMS x86_64-linux-gnu DEPENDENCIES + base64 bundler (>= 2.3.5) + csv html-proofer (~> 5.0) jekyll-github-metadata (>= 2.15) jekyll-include-cache diff --git a/fixtures/Gemfile-jekyll-3.9 b/fixtures/Gemfile-jekyll-3.9 index 3fdb79f..bd425fa 100644 --- a/fixtures/Gemfile-jekyll-3.9 +++ b/fixtures/Gemfile-jekyll-3.9 @@ -2,6 +2,10 @@ source "https://rubygems.org" gem "jekyll", "~> 3.9" +gem "base64" +gem "bigdecimal" +gem "csv" + gem "jekyll-seo-tag", ">= 2.0" gem "rake", ">= 12.3.1" diff --git a/fixtures/Gemfile-jekyll-4.3 b/fixtures/Gemfile-jekyll-4.3 index 75e73f8..78c879e 100644 --- a/fixtures/Gemfile-jekyll-4.3 +++ b/fixtures/Gemfile-jekyll-4.3 @@ -2,6 +2,9 @@ source "https://rubygems.org" gem "jekyll", "~> 4.3" +gem "base64" +gem "csv" + gem "jekyll-seo-tag", ">= 2.0" gem "rake", ">= 12.3.1"