|
2 | 2 |
|
3 | 3 | set -ex
|
4 | 4 |
|
5 |
| -if [ -z ${RUBY_VERSION} ]; then |
6 |
| - RUBY_VERSION=`ruby -e 'puts RUBY_VERSION'` |
| 5 | +if [ -z ${RUBY_COMMIT} ]; then |
| 6 | + RUBY_COMMIT=v`ruby -e 'puts RUBY_VERSION.gsub(".", "_")'` |
7 | 7 | fi
|
8 | 8 |
|
9 |
| -echo "RUBY_VERSION = ${RUBY_VERSION}" |
| 9 | +if [ -z ${RBS_RDOC_BASE_DIR} ]; then |
| 10 | + RBS_RDOC_BASE_DIR=/tmp/rbs-rdoc |
| 11 | +fi |
10 | 12 |
|
11 | 13 | REPO_ROOT=$(cd $(dirname $(dirname $0)); pwd)
|
12 | 14 |
|
13 |
| -rm -f /tmp/ruby.tar.gz |
14 |
| -rm -rf /tmp/ruby-${RUBY_VERSION} |
| 15 | +echo "RBS_RDOC_BASE_DIR = ${RBS_RDOC_BASE_DIR}" |
| 16 | +echo "RUBY_COMMIT = ${RUBY_COMMIT}" |
| 17 | + |
| 18 | +RUBY_SRC_DIR=${RBS_RDOC_BASE_DIR}/ruby-${RUBY_COMMIT} |
| 19 | +RDOC_OUT_DIR=${RBS_RDOC_BASE_DIR}/rdoc-${RUBY_COMMIT} |
15 | 20 |
|
16 |
| -curl -L https://cache.ruby-lang.org/pub/ruby/${RUBY_VERSION%.*}/ruby-${RUBY_VERSION}.tar.gz | tar xzf - -C /tmp |
| 21 | +rm -rf ${RUBY_SRC_DIR} ${RDOC_OUT_DIR} |
17 | 22 |
|
18 |
| -rm -rf /tmp/rdoc-${RUBY_VERSION} |
| 23 | +( |
| 24 | + mkdir -p ${RUBY_SRC_DIR} |
| 25 | + cd ${RUBY_SRC_DIR} |
| 26 | + git init |
| 27 | + git remote add origin https://github.com/ruby/ruby.git |
| 28 | + git fetch --depth 1 origin ${RUBY_COMMIT} |
| 29 | + git checkout FETCH_HEAD |
| 30 | + bundle exec --gemfile=${REPO_ROOT}/Gemfile rdoc --output=${RDOC_OUT_DIR} --root="." --all --ri --page-dir="doc" "." |
| 31 | +) |
19 | 32 |
|
20 |
| -cd /tmp/ruby-${RUBY_VERSION} |
21 |
| -bundle exec --gemfile=${REPO_ROOT}/Gemfile rdoc --output=/tmp/rdoc-${RUBY_VERSION} --root="." --all --ri --page-dir="doc" "." |
22 |
| -cd ${REPO_ROOT} |
23 |
| -bundle exec rbs annotate --no-system --no-gems --no-site --no-home -d /tmp/rdoc-${RUBY_VERSION} core stdlib |
| 33 | +bundle exec rbs annotate --no-system --no-gems --no-site --no-home -d ${RDOC_OUT_DIR} core stdlib |
0 commit comments