diff --git a/.github/workflows/create-doc-page.yml b/.github/workflows/create-doc-page.yml new file mode 100644 index 0000000..e9aa3a9 --- /dev/null +++ b/.github/workflows/create-doc-page.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index af5d0b5..9028f6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 \ No newline at end of file + GEM_HOST_OTP_CODE: ${{ secrets.GEM_HOST_OTP_CODE }} + run: gem push mp-utils-*.gem \ No newline at end of file diff --git a/.github/workflows/ruby-ci.yml b/.github/workflows/ruby-ci.yml index 42243c7..f745a95 100644 --- a/.github/workflows/ruby-ci.yml +++ b/.github/workflows/ruby-ci.yml @@ -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 \ No newline at end of file + uses: ./.github/workflows/ruby-tests.yml \ No newline at end of file diff --git a/.github/workflows/ruby-tests.yml b/.github/workflows/ruby-tests.yml new file mode 100644 index 0000000..7bb12fd --- /dev/null +++ b/.github/workflows/ruby-tests.yml @@ -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 \ No newline at end of file diff --git a/lib/version.rb b/lib/version.rb index deb7563..8b87feb 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -2,5 +2,5 @@ # @!visibility private module MPUtils - VERSION = '0.2.2' + VERSION = '0.2.3' end