Sha256: 1c16c8ac9dede160dfce05f1233b2b8d7d2e68ab479e95d5e0ce38ad3f9852b7

Contents?: true

Size: 1.62 KB

Versions: 2

Compression:

Stored size: 1.62 KB

Contents

name: Release Gem Package

on:
  push:
    branches:
      - master

jobs:
  release_version:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v2

      - name: Set Up Ruby
        uses: actions/setup-ruby@v1
        with:
          ruby-version: 3.0

      - name: Install Dependencies
        run: |
          gem install bundler
          bundle install

      - name: Build Gem Package
        run: |
          gem build middleware_rubygem.gemspec

      - name: Get the new Version
        id: get_new_version
        run: |
          # Extract the new version from the commit
          NEW_VERSION=$(git show HEAD:lib/middleware/ruby_gem/version.rb | grep 'VERSION =' | awk '{print $3}' | tr -d '"')
          echo "::set-output name=version::$NEW_VERSION"

      - name: Publish Gem Package
        env:
          GEM_HOST_API_KEY: ${{ secrets.RUBY_GEMS_API_KEY }}
        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 build *.gemspec
          gem push *.gem

      - name: Create Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: v${{ steps.get_new_version.outputs.version }}
          release_name: Release ${{ steps.get_new_version.outputs.version }}
          body: |
            Release ${{ steps.get_new_version.outputs.version }}
          draft: false
          prerelease: false

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
middleware_apm-1.1.0 .github/workflows/master.yaml
middleware_apm-1.0.0 .github/workflows/master.yaml