-
Notifications
You must be signed in to change notification settings - Fork 41
74 lines (60 loc) · 2.13 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Release
on:
push:
tags:
- "*"
jobs:
deployDocs:
name: Build code and generate docs site
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies, build project
run: npm install
env:
CI: true
- name: Use OCaml
uses: fangyi-zhou/actions-ocaml@v1
with:
ocaml_version: 4.06.1
- name: Install Odoc
run: opam install odoc --yes
- name: Install Esy
run: npm install -g [email protected]
- name: Build bsdoc for Linux
run: |
git clone https://github.com/reuniverse/bsdoc.git
cd bsdoc
esy install
esy release
find _release/_export/ -iname "bsdoc*" -exec tar -zxvf {} --strip-components 1 \;
- name: Generate docs
run: |
# clean __tests__ to not have test modules in a wrapping module in docs
rm -r ./__tests__/*
npm run clean
npm run build
# generate docs
./bsdoc/bin/bsdoc support-files
./bsdoc/bin/bsdoc build -v --debug api
# move wrapping module docs to top-level module dir and generate module links
mv ./docs/api/Relude/index.html ./docs/api/
sed -i -E "s/([a-zA-Z_]*) = ([a-zA-Z_-]*)/\1 = <a href=\"\.\/\2\">\2<\/a>/g" ./docs/api/index.html
# adjust css-related links
sed -i -E "s/\.\.\/odoc/odoc/g" ./docs/api/index.html
sed -i -E "s/\.\.\/highlight/highlight/g" ./docs/api/index.html
# add highlight.js style to end of stylesheet
echo '@import url("https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/atom-one-light.min.css");' >> ./docs/odoc.css
- name: Deploy docs to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs