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 17, 2024
1 parent 49c6799 commit fef6bcd
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 56 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/create-doc-page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Create Documentation Page

on:
workflow_dispatch:

jobs:
document:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2

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

- name: Instalar dependências
run: bundle install

- name: Gerar documentação
run: |
yard doc
mkdir -p docs
mv -f doc/* docs/
- name: Deploy para GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
34 changes: 4 additions & 30 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 All @@ -43,22 +23,16 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
ruby-version: '2.6'

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

- name: Generate Documentation
run: |
yard doc
mkdir -p docs
mv -f doc/* docs/
- name: Build gem
run: gem build mp-utils.gemspec

- 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
2 changes: 1 addition & 1 deletion lib/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

# @!visibility private
module MPUtils
VERSION = '0.2.2'
VERSION = '0.2.3'
end

0 comments on commit fef6bcd

Please sign in to comment.