forked from faker-ruby/faker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request faker-ruby#2584 from bijoysijo/automate-release-1
Automate workflow to publish to RubyGems.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
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 |