Sha256: 7ed7bb9c32da7fd2be8db989e0a620ffb27f453bf33418f52140e0788dad0748

Contents?: true

Size: 1.78 KB

Versions: 1

Compression:

Stored size: 1.78 KB

Contents

name: Build and Release

on:
  push:
    branches:
      - main
    paths:
      - lib/terradactyl/terraform/version.rb

jobs:
  release:
    env:
      GEM_NAME: terradactyl-terraform
      VERSION_FILE: lib/terradactyl/terraform/version.rb
      CHANGELOG: CHANGELOG.md
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      GEM_HOST_API_KEY: ${{ secrets.VCILABS_GEM_HOST_API_KEY }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2
      - name: Setup Ruby
        uses: actions/setup-ruby@v1
        with:
          ruby-version: '2.7'
          bundler-cache: true
      - name: Build Gem
        id: build
        run: |
          RELEASE_VERSION=$(grep VERSION ${VERSION_FILE} | tr -d "VERSION= \'")
          RELEASE_BODY_PATH=body.md
          echo RELEASE_VERSION=${RELEASE_VERSION}     >> $GITHUB_ENV
          echo RELEASE_BODY_PATH=${RELEASE_BODY_PATH} >> $GITHUB_ENV
          sed -ne "/## ${RELEASE_VERSION}.*/,/#/p" ${CHANGELOG} | sed -e '$d' > $RELEASE_BODY_PATH
          gem build
      - name: Create Release
        id: release
        uses: actions/create-release@v1
        with:
          tag_name: v${{ env.RELEASE_VERSION }}
          release_name: v${{ env.RELEASE_VERSION }}
          body: ${{ env.RELEASE_BODY }}
          draft: false
          prerelease: false
      - name: Upload Asset
        id: asset
        uses: actions/upload-release-asset@v1
        with:
          upload_url: ${{ steps.release.outputs.upload_url }}
          asset_path: ${{ env.GEM_NAME }}-${{ env.RELEASE_VERSION}}.gem
          asset_name: ${{ env.GEM_NAME }}-${{ env.RELEASE_VERSION}}.gem
          asset_content_type: application/x-tar
      - name: Publish Gem
        id: publish
        run: gem push ${{ env.GEM_NAME }}-${{ env.RELEASE_VERSION}}.gem

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
terradactyl-terraform-0.13.0 .github/workflows/build-and-release.yml