Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new Ruby gem release workflow #31

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 4 additions & 18 deletions .github/workflows/ruby-release-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,15 @@ on:
ruby-version:
description: Ruby version
required: false
default: "3.2"
default: "ruby" # latest
type: string
otp:
description: One-time password for RubyGems.org
required: true
type: string
secrets:
api-key:
description: API key for RubyGems.org
required: true

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
timeout-minutes: 10
steps:
- name: Checkout
Expand All @@ -31,15 +24,8 @@ jobs:
with:
ruby-version: ${{ inputs.ruby-version }}
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: Release gem
run: bundle exec rake release
env:
GEM_HOST_API_KEY: ${{ secrets.api-key }}
GEM_HOST_OTP_CODE: ${{ inputs.otp }}
- name: Publish gem to RubyGems.org
uses: rubygems/release-gem@v1
- name: Create GitHub release
run: |
tag_name="$(git describe --tags --abbrev=0)"
Expand Down