Skip to content

Commit

Permalink
Upgrade rakefile and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcioFPaludo committed Jul 2, 2024
1 parent 69377bd commit be08c6f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-doc-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- name: Gerar documentação
run: |
yard doc
rake doc:generate
mkdir -p docs
mv -f doc/* docs/
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ permissions:

jobs:
tests:
secrets: inherit
uses: ./.github/workflows/ruby-tests.yml
documentation:
needs: tests
uses: ./.github/workflows/create-doc-page.yml
secrets: inherit
uses: ./.github/workflows/create-doc-page.yml
1 change: 1 addition & 0 deletions .github/workflows/ruby-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ on:

jobs:
tests:
secrets: inherit
uses: ./.github/workflows/ruby-tests.yml
7 changes: 4 additions & 3 deletions .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ on:
types:
- closed

permissions:
contents: read
packages: write

jobs:
bump_version:
name: Build + Publish
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
if: >
github.event.pull_request.merged == true &&
contains(join(github.event.pull_request.labels.*.name, ','), 'version:major') ||
Expand Down
18 changes: 15 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'bundler/gem_tasks'
require 'rake/clean'
require 'fileutils'
require 'rake'

require_relative 'lib/mp_utils'
Expand Down Expand Up @@ -41,10 +42,21 @@ namespace :version do
end

namespace :doc do
desc 'Bump version'
task :test do
desc 'Generate all needed documentation'
task :generate do
system('yard doc')
source_dir = '.resources/images'
destination_dir = 'doc/.resources/images'
FileUtils.mkdir_p(destination_dir)
Dir.glob("#{source_dir}/*.{png,jpg,jpeg,gif}").each do |image|
FileUtils.cp(image, destination_dir)
end
end

desc 'Generates the doc and make a local server for test the documentation'
task :test do
system('rake doc:generate')
system('open "http://localhost:8808"')
system('yard server')
system('yard server --reload')
end
end

0 comments on commit be08c6f

Please sign in to comment.