Sha256: 2959cc42c65db37a09a15f4e6b9f951761236f81bb84c1f3cedc2618725a9979

Contents?: true

Size: 1.69 KB

Versions: 2

Compression:

Stored size: 1.69 KB

Contents

name: Test and Release

on:
  push:
    branches: 
      - main

jobs:
  tests:
    strategy:
      matrix:
        ruby: [2.5, 2.6, 2.7, 3.0]
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true
    - name: Run linter
      run: bundle exec rubocop
    - name: Run tests
      run: bundle exec rspec
  prettier:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Node
      uses: actions/setup-node@v2
      with:
        node-version: '14'
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 3.0
        bundler-cache: true
    - name: Install yarn dep
      run: yarn install
    - name: Check prettier
      run: yarn prettier -c '**/*.rb' 
  release:
    needs: [tests, prettier]
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 3.0
        bundler-cache: true
    - name: Prepare credentials
      env:
        RUBYGEM_KEY: ${{ secrets.RUBYGEM_KEY }}
      run: "mkdir -p ~/.gem && echo -e \"---\\r\\n:rubygems_api_key: $RUBYGEM_KEY\" > ~/.gem/credentials && chmod 0600 ~/.gem/credentials"
    - name: Setup username/email
      run: "git config --global user.email zaratan@hey.com && git config --global user.name \"Denis <Zaratan> Pasin\""
    - name: Fetch tags from remote
      run: "git fetch -t"
    - name: Publish if version change
      run: 'git diff `git tag | tail -1` -- lib/omniauth_forge/version.rb | grep -E "^\+.*VERSION" && rake release || echo "No release for now"'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
omniauth-forge-0.2.1 .github/workflows/test_and_publish.yml
omniauth-forge-0.2.0 .github/workflows/test_and_publish.yml