From c6e74bbfe7a0d0ae8c806cb38b012d01b25b1f7d Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Fri, 6 Sep 2024 17:32:13 +0530 Subject: [PATCH] Release gem from 2.5-stable via GitHub Actions (#802) Merge pull request 802 --- .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++++++ minima.gemspec | 7 +++++-- theme_version.rb | 5 +++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 theme_version.rb 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 }} diff --git a/minima.gemspec b/minima.gemspec index 4b26f34796..467b343419 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"] @@ -16,8 +18,9 @@ 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" - spec.add_development_dependency "bundler", ">= 1.15" end 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