File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,14 +61,11 @@ jobs:
6161 exit $fail
6262 working-directory : include
6363
64- - name : Generate docs
65- id : docs
64+ - name : Check if to generate documents
65+ id : rdoc
6666 run : |
67- $RDOC -C -x ^ext -x ^lib .
68- $RDOC --op html .
69- echo htmlout=ruby-html-${GITHUB_SHA:0:10} >> $GITHUB_OUTPUT
70- env :
71- RDOC : ruby -W0 --disable-gems tool/rdoc-srcdir -q
67+ ref=$(sed 's/#.*//;/^rdoc /!d' gems/bundled_gems | awk '{print $4}')
68+ echo ref=$ref >> $GITHUB_OUTPUT
7269 # Generate only when document commit/PR
7370 if : >-
7471 ${{false
8077 || contains(github.event.pull_request.labels.*.name, 'Documentation')
8178 }}
8279
80+ - name : Checkout rdoc
81+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
82+ with :
83+ repository : ruby/rdoc
84+ ref : ${{ steps.rdoc.outputs.ref }}
85+ path : .bundle/gems/rdoc-0
86+ if : ${{ steps.rdoc.outputs.ref != '' }}
87+
88+ - name : Generate rdoc
89+ run : |
90+ gempath=$(gem install --user bundler 2>&1 1>/dev/null | sed -n '/WARNING:.*have \(.*\) in your PATH.*/!d;s//\1/')
91+ PATH=$gempath:$PATH
92+ bundle install
93+ bundle exec rake generate
94+ working-directory : .bundle/gems/rdoc-0
95+ if : ${{ steps.rdoc.outputs.ref != '' }}
96+
97+ - name : Generate docs
98+ id : docs
99+ run : |
100+ $RDOC -C -x ^ext -x ^lib .
101+ $RDOC --op html .
102+ echo htmlout=ruby-html-${GITHUB_SHA:0:10} >> $GITHUB_OUTPUT
103+ env :
104+ RDOC : ruby -W0 --disable-gems tool/rdoc-srcdir -q
105+ if : ${{ steps.rdoc.outcome == 'success' }}
106+
83107 - name : Upload docs
84108 uses : actions/upload-artifact@v4
85109 with :
You can’t perform that action at this time.
0 commit comments