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

Automate workflow to publish to RubyGems. #2584

Merged
merged 7 commits into from
Oct 20, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish to RubyGems

on:
release:
types:
- [ created ]
push:
tags:
- "v*"

Zeragamba marked this conversation as resolved.
Show resolved Hide resolved
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
env:
TARGET_URL: https://rubygems.org/gems/faker

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't have deployments or environments, so I don't think we need this step.


- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.2

- name: Build Gem
run: gem build -o faker.gem faker.gemspec

stefannibrasil marked this conversation as resolved.
Show resolved Hide resolved
- name: Push to RubyGems
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
run: gem push faker.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 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here, we don't have deployments nor notifications, so this is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update and push.