Skip to content

Commit

Permalink
Add gem release github action
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesluedke committed Mar 2, 2023
1 parent b90d25d commit 4a54c63
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Gem Build and Release

on:
push:
Expand All @@ -8,6 +8,7 @@ on:

jobs:
test:
name: Gem / Test
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -29,3 +30,27 @@ jobs:
run: bundle exec rubocop
- name: Run tests
run: bundle exec rspec

release:
name: Gem / Release
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: fac/ruby-gem-setup-credentials-action@v2
with:
user: ''
key: rubygems
token: ${{ secrets.RUBYGEMS_API_KEY }}
- name: Build Gem
run: bundle exec rake build
- name: Release Gem
if: github.ref == 'refs/heads/master'
uses: fac/ruby-gem-push-action@v2
with:
key: rubygems
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ PLATFORMS
arm64-darwin-22
x86_64-darwin-20
x86_64-darwin-21
x86_64-darwin-22
x86_64-linux

DEPENDENCIES
Expand Down

0 comments on commit 4a54c63

Please sign in to comment.