Skip to content

Commit 24d1db5

Browse files
authored
Merge pull request #6 from bcylin/feature/auto-generated-docs
Auto Generated Documentation
2 parents 8379143 + 0fde41d commit 24d1db5

5 files changed

Lines changed: 43 additions & 11 deletions

File tree

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ matrix:
55
- env: VERSION=9.3
66
- env: VERSION=latest
77
before_script:
8-
- bundle exec danger
8+
- if [ -n "$DANGER_GITHUB_API_TOKEN" ]; then bundle exec danger; fi
99
script:
1010
- bundle exec rake ci:build[$VERSION]
11-
- make carthage
11+
- make -B carthage
12+
- make -B docs
1213
after_script:
13-
- make documentation
14+
- sh scripts/update-docs.sh
1415
cache:
1516
bundler: true
1617
directories:

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ source "http://rubygems.org"
22
ruby "2.3.1"
33

44
gem "cocoapods", "~> 1.0.0"
5-
gem "danger", "~> 3.4.0"
5+
gem "danger", "~> 3.5.0"
66
gem "jazzy", "~> 0.7.0"
77
gem "pry"
88
gem "rake"

Gemfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ GEM
4848
concurrent-ruby (1.0.2)
4949
cork (0.2.0)
5050
colored (~> 1.2)
51-
danger (3.4.2)
51+
danger (3.5.0)
5252
claide (~> 1.0)
53-
claide-plugins (> 0.9.0)
53+
claide-plugins (>= 0.9.2)
5454
colored (~> 1.2)
5555
cork (~> 0.1)
5656
faraday (~> 0.9)
@@ -88,7 +88,7 @@ GEM
8888
kramdown (1.12.0)
8989
liferaft (0.0.4)
9090
method_source (0.8.2)
91-
minitest (5.9.0)
91+
minitest (5.9.1)
9292
molinillo (0.4.5)
9393
multi_xml (0.5.5)
9494
multipart-post (2.0.0)
@@ -102,7 +102,7 @@ GEM
102102
coderay (~> 1.1.0)
103103
method_source (~> 0.8.1)
104104
slop (~> 3.4)
105-
rake (11.2.2)
105+
rake (11.3.0)
106106
redcarpet (3.3.4)
107107
rouge (1.11.1)
108108
sass (3.4.22)
@@ -123,15 +123,15 @@ GEM
123123
activesupport (>= 3)
124124
claide (>= 1.0.0, < 2.0)
125125
colored (~> 1.2)
126-
xcpretty (0.2.2)
126+
xcpretty (0.2.3)
127127
rouge (~> 1.8)
128128

129129
PLATFORMS
130130
ruby
131131

132132
DEPENDENCIES
133133
cocoapods (~> 1.0.0)
134-
danger (~> 3.4.0)
134+
danger (~> 3.5.0)
135135
jazzy (~> 0.7.0)
136136
pry
137137
rake

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ setup: brew-install
1818
carthage:
1919
set -o pipefail && carthage build --no-skip-current --verbose | xcpretty
2020

21-
documentation:
21+
docs:
22+
rm -rfv docs
23+
git clone -b gh-pages --single-branch https://github.com/polydice/ICInputAccessory.git docs
2224
bundle exec jazzy --config .jazzy.yml

scripts/update-docs.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
3+
files=(html css js json)
4+
5+
for file in "${files[@]}"
6+
do
7+
echo "Cleaning whitespace in *.$file..."
8+
find docs/output -name "*."$file -exec sed -E -i '' -e 's/[[:blank:]]*$//' {} \;
9+
done
10+
11+
12+
cd docs && pwd
13+
git checkout gh-pages
14+
git status
15+
cp -rfv output/* .
16+
git --no-pager diff --stat
17+
git add .
18+
git commit -m "[CI] Update documentation at $(date +'%Y-%m-%d %H:%M:%S %z')"
19+
20+
if [ "${TRAVIS_BRANCH}" = "master" ] && [ -n "$DANGER_GITHUB_API_TOKEN" ]; then
21+
echo "Updating gh-pages..."
22+
git remote add upstream "https://${DANGER_GITHUB_API_TOKEN}@github.com/polydice/ICInputAccessory.git"
23+
git push --quiet upstream HEAD:gh-pages
24+
git remote remove upstream
25+
else
26+
echo "Skip gh-pages updates on ${TRAVIS_BRANCH}"
27+
fi
28+
29+
cd -

0 commit comments

Comments
 (0)