Skip to content

Commit

Permalink
Update release to work with otp code
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcioFPaludo committed Jun 16, 2024
1 parent 49c6799 commit 8b03450
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 48 deletions.
26 changes: 3 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,7 @@ permissions:

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.2']

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Bundle Install
run: bundle check || bundle install -j 20

- name: Rubocop
run: bundle exec rubocop

- name: RSpec
run: bundle exec rspec --format documentation
uses: ./.github/workflows/ruby-tests.yml
release:
needs: tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -60,5 +40,5 @@ jobs:
- name: Publish gem
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
GEM_HOST_OTP_CODE: ${{ github.event.inputs.otp_code }}
run: echo $GEM_HOST_OTP_CODE | gem push mp-utils-*.gem --otp
GEM_HOST_OTP_CODE: ${{ secrets.GEM_HOST_OTP_CODE }}
run: gem push mp-utils-*.gem
26 changes: 1 addition & 25 deletions .github/workflows/ruby-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,6 @@ on:
pull_request:
branches: [ "main" ]

permissions:
contents: read
packages: write

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.2']

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Bundle Install
run: bundle check || bundle install -j 20

- name: Rubocop
run: bundle exec rubocop

- name: RSpec
run: bundle exec rspec --format documentation
uses: ./.github/workflows/ruby-tests.yml
32 changes: 32 additions & 0 deletions .github/workflows/ruby-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Ruby Tests

on:
workflow_call:

permissions:
contents: read
packages: write

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.2']

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Bundle Install
run: bundle check || bundle install -j 20

- name: Rubocop
run: bundle exec rubocop

- name: RSpec
run: bundle exec rspec --format documentation

0 comments on commit 8b03450

Please sign in to comment.