Sha256: 9d2d7c2c1f2bd736619867397ed326d068cd93114df19426fc451766ef82017e

Contents?: true

Size: 1.79 KB

Versions: 1

Compression:

Stored size: 1.79 KB

Contents

name: Release Backport

on:
  push:
    branches:
      - "*-stable"
    paths:
      - "lib/**/version.rb"

jobs:
  release:
    if: "github.repository_owner == 'jekyll'"
    name: "Release Backport (Ruby ${{ matrix.ruby_version }})"
    runs-on: "ubuntu-latest"
    strategy:
      fail-fast: true
      matrix:
        ruby_version:
          - 2.7
    steps:
      - name: Checkout Repository
        uses: actions/checkout@v2
      - name: "Set up Ruby ${{ matrix.ruby_version }}"
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby_version }}
          bundler-cache: true
      - name: Extract Plugin Meta
        id: plugin-meta
        run: |
          echo "::set-output name=tag_version::$(bundle exec rake project:tag_version)"
          echo "::set-output name=gem_name::$(bundle exec rake project:gem_name)"
        shell: bash
      - name: "Build Gem (${{ steps.plugin-meta.outputs.gem_name }})"
        run: bundle exec rake build
      - name: Archive gem as artifact
        uses: actions/upload-artifact@v2
        with:
          name: "${{ steps.plugin-meta.outputs.gem_name }}"
          path: "pkg/${{ steps.plugin-meta.outputs.gem_name }}.gem"
          retention-days: 5
      - name: Release Gem via Rubygems.org
        env:
          GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_GEM_PUSH_API_KEY }}
        run: |
          git config user.name "${{ github.actor }}"
          git config user.email "${{ github.actor }}@users.noreply.github.com"
          git tag ${{ steps.plugin-meta.outputs.tag_version }} \
            -m "Release :gem: ${{ steps.plugin-meta.outputs.tag_version }}" \
            ${{ github.event.head_commit.id }}
          git push origin ${{ steps.plugin-meta.outputs.tag_version }}
          gem push pkg/${{ steps.plugin-meta.outputs.gem_name }}.gem

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll_test_plugin-0.0.2 .github/workflows/backport.yml