From 11e6fd7964836de48e9bbdf81fb1117567351958 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Fri, 6 Sep 2024 16:56:56 +0530 Subject: [PATCH 1/4] Add workflow to release gem via GA --- .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..4a2bc926a3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release Gem + +on: + push: + branches: + - "2.5-stable" + paths: + - "theme_version.rb" + +jobs: + release: + if: "github.repository_owner == 'jekyll'" + name: "Release Gem (Ruby ${{ matrix.ruby_version }})" + runs-on: "ubuntu-latest" + strategy: + fail-fast: true + matrix: + ruby_version: [ "3.3" ] + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: "Set up Ruby ${{ matrix.ruby_version }}" + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby_version }} + bundler-cache: true + - name: Build and Publish Gem + uses: ashmaroli/release-gem@dist + with: + gemspec_name: minima + env: + GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_GEM_PUSH_API_KEY }} From 897ed85959ffa09edd2bf156053bfe931d660fea Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Fri, 6 Sep 2024 17:04:15 +0530 Subject: [PATCH 2/4] Add a Ruby file to declare version Extracting version string to a separate file so that procedural edits to `minima.gemspec` does not trigger the `release` workflow. --- theme_version.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 theme_version.rb diff --git a/theme_version.rb b/theme_version.rb new file mode 100644 index 0000000000..6d80c4da81 --- /dev/null +++ b/theme_version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module Minima + VERSION = "2.5.2" +end From d0319556d0e53bd1a3341a85e825a136dcbad52b Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Fri, 6 Sep 2024 17:08:47 +0530 Subject: [PATCH 3/4] Import theme version into gemspec --- minima.gemspec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/minima.gemspec b/minima.gemspec index 4b26f34796..8b3bc3a667 100644 --- a/minima.gemspec +++ b/minima.gemspec @@ -1,8 +1,10 @@ # frozen_string_literal: true +require_relative "theme_version" + Gem::Specification.new do |spec| spec.name = "minima" - spec.version = "2.5.1" + spec.version = Minima::VERSION spec.authors = ["Joel Glovier"] spec.email = ["jglovier@github.com"] @@ -19,5 +21,4 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency "jekyll", ">= 3.5", "< 5.0" spec.add_runtime_dependency "jekyll-feed", "~> 0.9" spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.1" - spec.add_development_dependency "bundler", ">= 1.15" end From 67a6d4b4416b934379a34df604638bbee0abef67 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Fri, 6 Sep 2024 17:29:19 +0530 Subject: [PATCH 4/4] Add `required_ruby_version` in gemspec Add `required_ruby_version` to remove the recommendation log output from rubygems Set to the lowest Ruby version tested against. --- minima.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/minima.gemspec b/minima.gemspec index 8b3bc3a667..467b343419 100644 --- a/minima.gemspec +++ b/minima.gemspec @@ -18,6 +18,8 @@ Gem::Specification.new do |spec| f.match(%r!^(assets|_(includes|layouts|sass)/|(LICENSE|README)((\.(txt|md|markdown)|$)))!i) end + spec.required_ruby_version = ">= 2.7.0" + spec.add_runtime_dependency "jekyll", ">= 3.5", "< 5.0" spec.add_runtime_dependency "jekyll-feed", "~> 0.9" spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.1"