Sha256: 7bfe68e3f1ab5c8a5086fd67e50627ba25f05155d8b7c97a7219e8c1b960b5cb

Contents?: true

Size: 1.88 KB

Versions: 1

Compression:

Stored size: 1.88 KB

Contents

name: Release
on:
  push:
    branches:
      - master
jobs:
  check-release:
    container:
      image: ruby:3.1
    outputs:
      release: ${{ steps.check-release.outputs.release }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 2
      # See https://github.com/actions/runner-images/issues/6775.
      - name: Suppress 'detected dubious ownership' error.
        run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
      - id: check-release
        name: Decide whether to release
        run: |
          set +e
          git diff --exit-code --quiet HEAD~1 -- lib/jekyll-linkpreview/version.rb
          if [ $? = 1 ]; then
            echo release=true >> ${GITHUB_OUTPUT}
          else
            echo release=false >> ${GITHUB_OUTPUT}
          fi
  release:
    container:
      image: ruby:3.1
    if: needs.check-release.outputs.release == 'true'
    needs: check-release
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      # See https://github.com/actions/runner-images/issues/6775.
      - name: Suppress 'detected dubious ownership' error.
        run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
      - env:
          RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
        name: Set credentials for RubyGems
        run: |
          mkdir ~/.gem
          echo :rubygems_api_key: ${RUBYGEMS_API_KEY} > ~/.gem/credentials
          chmod 0600 ~/.gem/credentials
      - name: Configure git
        run: |
          git config --global user.email "yusuke.nishioka.0713@gmail.com"
          git config --global user.name "Yusuke Nishioka"
      - name: Install dependencies
        run: bundle install
      - env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        name: Make a new release
        run: bundle exec rake release

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll-linkpreview-0.7.0 .github/workflows/release.yaml