Skip to content

[2.3.0] 2025-01-10

[2.3.0] 2025-01-10 #44

Workflow file for this run

name: Publish to RubyGems
on:
release:
types: [created]
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
env:
TARGET_URL: https://rubygems.org/gems/patch_ruby
steps:
- name: Check out code
uses: actions/checkout@v2
- uses: chrnorm/deployment-action@releases/v1
name: Create GitHub deployment
id: deployment
with:
token: "${{ github.token }}"
target_url: ${{ env.TARGET_URL }}
environment: production
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.1
- name: Build Gem
run: gem build -o patch_ruby.gem patch_ruby.gemspec
- name: Install Ruby Dependencies
run: bundle install
- name: Run RSpec
env:
SANDBOX_API_KEY: ${{ secrets.SANDBOX_API_KEY }}
run: bundle exec rspec
- name: Push to RubyGems
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
run: gem push patch_ruby.gem
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: ${{ env.TARGET_URL }}
state: "success"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@releases/v1
with:
token: "${{ github.token }}"
target_url: ${{ env.TARGET_URL }}
state: "failure"
deployment_id: ${{ steps.deployment.outputs.deployment_id }}