From 2e453edb1ba4d63bc31b303853e3161507f1f4f9 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Thu, 5 Dec 2024 21:16:47 +0530 Subject: [PATCH] Add workflow to release gem via GitHub Actions --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 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 0000000..f8f0433 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: Release Gem + +on: + push: + branches: ["master"] + paths: ["lib/**/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: ["2.7"] + 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: "jekyll-archives" + env: + GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_GEM_PUSH_API_KEY }}