Sha256: 4757ca55724bb887598efef88c537e75d1589fa93f1e8779d68bd3af3833cfb0

Contents?: true

Size: 1.71 KB

Versions: 1

Compression:

Stored size: 1.71 KB

Contents

# RubyGems publish GitHub Actions workflow file by @ybiquitous.
# https://ybiquitous.me/blog/2022/release-gem-using-github-actions
# License for this file: CC BY-SA 4.0 https://creativecommons.org/licenses/by-sa/4.0/

name: Release

on:
    workflow_dispatch:
        inputs:
            otp:
                description: "One-time password for RubyGems.org"
                required: true

concurrency:
    group: ${{ github.workflow }}
    cancel-in-progress: true

jobs:
    release:
        runs-on: ubuntu-latest
        permissions:
            contents: write
        steps:
            -   name: Checkout
                uses: actions/checkout@v3

            -   name: Set up Ruby
                uses: ruby/setup-ruby@v1
                with:
                    ruby-version: "3.1"
                    bundler-cache: true

            -   name: Configure Git
                run: |
                    git config --global user.name "${GITHUB_ACTOR}"
                    git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"

            -   name: Publish to gem registry
                run: bundle exec rake release
                env:
                    GEM_HOST_API_KEY: ${{ secrets.API_KEY }}
                    GEM_HOST_OTP_CODE: ${{ inputs.otp }}

            -   name: Push tag
                run: git push --follow-tags

            -   name: Get tag
                run: echo "::set-output name=name::$(git describe --abbrev=0)"
                id: tag

            -   name: Create GitHub release
                run: gh release create "${TAG_NAME}" --draft
                env:
                    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
                    TAG_NAME: ${{ steps.tag.outputs.name }}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll-shields_io-0.2.0 .github/workflows/release.yml