Sha256: 2f8ea384441d6bab8580bb98cdc8ef2e754d90e8d3e67e33dfb63ab5118608c2

Contents?: true

Size: 1.61 KB

Versions: 1

Compression:

Stored size: 1.61 KB

Contents

name: Test, Publish, and Release

on:
  pull_request:
    branches: [production]
    types: [closed]

jobs:
  build_and_publish:
    runs-on: ubuntu-latest
    if: github.event.pull_request.merged
    
    steps:
    - uses: actions/checkout@v2
    
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 3.0.1

    - name: Build gem
      run: |
        gem install bundler
        bundler install
        gem build easy-jsonapi.gemspec
  
    - name: Publish to GPR
      run: |
        mkdir -p $HOME/.gem
        touch $HOME/.gem/credentials
        chmod 0600 $HOME/.gem/credentials
        printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
        gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
      env:
        GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
        OWNER: ${{ github.repository_owner }}
    
    - name: Publish to RubyGems
      run: |
        mkdir -p $HOME/.gem
        touch $HOME/.gem/credentials
        chmod 0600 $HOME/.gem/credentials
        printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
        gem push *.gem
      env:
        GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
    
    - name: Create Release
      id: create_release
      uses: actions/create-release@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
      with:
        tag_name: 1.0.9 # update this to release
        release_name: Release 1.0.9 # update this to release
        draft: false
        prerelease: false

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
easy-jsonapi-1.0.9 .github/workflows/publish.yml