Skip to content

Commit

Permalink
Merge pull request faker-ruby#2584 from bijoysijo/automate-release-1
Browse files Browse the repository at this point in the history
Automate workflow to publish to RubyGems.
  • Loading branch information
vbrazo authored Oct 20, 2022
2 parents a698061 + f12165e commit 8b7c41e
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish to RubyGems

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

permissions:
contents: read

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

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

- name: Install dependencies
run: bundle install

- name: Run tests
run: bundle exec rake test

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

- name: Push to RubyGems
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
run: gem push faker.gem

0 comments on commit 8b7c41e

Please sign in to comment.