From 4a54c637f342d6c00752bf20befa4d5a25d63b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Lu=CC=88dke?= Date: Thu, 2 Mar 2023 11:06:49 +0100 Subject: [PATCH] Add gem release github action --- .github/workflows/build.yml | 27 ++++++++++++++++++++++++++- Gemfile.lock | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30eda72..e09dea1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build +name: Gem Build and Release on: push: @@ -8,6 +8,7 @@ on: jobs: test: + name: Gem / Test runs-on: ubuntu-latest strategy: matrix: @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index fc9d0d9..7b70c46 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -96,6 +96,7 @@ PLATFORMS arm64-darwin-22 x86_64-darwin-20 x86_64-darwin-21 + x86_64-darwin-22 x86_64-linux DEPENDENCIES