Build and Release Gem #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release Gem | |
on: | |
# This event will only trigger a workflow run if the workflow file is on the default branch. | |
# https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#workflow_run | |
workflow_run: | |
workflows: ["Tests"] | |
types: | |
- completed | |
jobs: | |
release: | |
name: Release to RubyGems.org | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/main' }} | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
# Build the gem package | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
# Release | |
- name: Release to RubyGems.org | |
uses: rubygems/release-gem@v1 |