-
Notifications
You must be signed in to change notification settings - Fork 14
98 lines (87 loc) · 2.66 KB
/
docs.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Docs
on:
push:
branches:
- main-v1
- main-v2
jobs:
build-api-docs:
name: Build API docs
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rust-docs
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
- name: Install JDK
uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "temurin"
- name: Install Doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen
- name: Build Rust doc
run: cargo doc -p longport --no-deps
- name: Build Python wheels
uses: PyO3/maturin-action@v1
with:
target: "x86_64"
args: -i python3.9 --out dist -m python/Cargo.toml
- name: Install built wheel
run: |
pip install longport --no-index --find-links dist --force-reinstall
python -c "import longport"
- name: Build Python docs
run: |
pip install -r docs/requirements.txt
mkdocs build
working-directory: ./python
- name: Build Node.js docs
run: |
npm install -g typedoc
typedoc
working-directory: ./nodejs
- name: Build Java docs
working-directory: ./java/javasrc
run: mvn javadoc:javadoc
- name: Build C docs
working-directory: ./c
run: doxygen
- name: Build C++ docs
working-directory: ./cpp
run: doxygen
- name: Doc version
run: echo DOC_VERSION=$(echo ${{ github.ref }} | sed 's/^refs\/heads\/main-//') >> $GITHUB_ENV
- name: Copy to gh-pages
run: |
mkdir -p gh-pages/$DOC_VERSION
mv -f target/doc gh-pages/$DOC_VERSION/rust
mv -f python/site gh-pages/$DOC_VERSION/python
mv -f nodejs/docs gh-pages/$DOC_VERSION/nodejs
mv -f java/javasrc/target/reports/apidocs gh-pages/$DOC_VERSION/java
mv -f c/html gh-pages/$DOC_VERSION/c
mv -f cpp/html gh-pages/$DOC_VERSION/cpp
cp .github/misc/templates/docs.html gh-pages/index.html
- name: Deploy
uses: peaceiris/[email protected]
with:
emptyCommits: true
keepFiles: true
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: gh-pages