-
Notifications
You must be signed in to change notification settings - Fork 34
158 lines (133 loc) · 4.55 KB
/
Copy pathci-docs.yaml
File metadata and controls
158 lines (133 loc) · 4.55 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
name: ci-docs
# Trigger the workflow when:
on:
# A push occurs to one of the matched branches.
push:
branches:
- main
# Cancel in-progress jobs on same branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rust-docs:
# NOTE: This name appears in GitHub's Checks API.
name: rust-docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust
run: rustup show
- name: Build docs
run: |
cargo doc \
--no-deps \
--package oasis-core-runtime \
--package oasis-runtime-sdk
cargo doc \
--no-deps \
--all-features \
--package oasis-runtime-sdk-macros \
--package oasis-runtime-sdk-contracts \
--package oasis-contract-sdk \
--package oasis-contract-sdk-types \
--package oasis-contract-sdk-storage \
--package rofl-utils \
--package oasis-rofl-client
- name: Deploy rust to api-reference branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/doc
publish_branch: api-reference
destination_dir: rust
commit_message: Deploy rust API reference ${{ github.event.head_commit.message }}
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
py-docs:
name: py-docs
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./rofl-client/py
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install sphinx myst-parser
- name: Build docs
run: |
make docs
- name: Deploy py to api-reference branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: rofl-client/py/docs/build/html
publish_branch: api-reference
destination_dir: py/rofl-client
commit_message: Deploy py API reference ${{ github.event.head_commit.message }}
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
js-docs:
name: js-docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js LTS
uses: actions/setup-node@v4
with:
node-version: "18.x"
cache: npm
cache-dependency-path: 'client-sdk/ts-web/package-lock.json'
- name: Install dependencies and build
working-directory: client-sdk/ts-web
run: npm ci --foreground-scripts
- name: core
working-directory: client-sdk/ts-web/core
run: npx typedoc
- name: rt
working-directory: client-sdk/ts-web/rt
run: npx typedoc
- name: ext-utils
working-directory: client-sdk/ts-web/ext-utils
run: npx typedoc
- name: signer-ledger
working-directory: client-sdk/ts-web/signer-ledger
run: npx typedoc
- name: Install ROFL client dependencies
working-directory: rofl-client/ts
run: npm ci
- name: Build and generate ROFL client docs
working-directory: rofl-client/ts
run: |
npm run build
npx typedoc
- name: Merge docs
working-directory: client-sdk/ts-web
run: |
mkdir docs
mv core/docs/api docs/client
mv rt/docs/api docs/client-rt
mv ext-utils/docs/api docs/client-ext-utils
mv signer-ledger/docs/api docs/client-signer-ledger
mv ../../rofl-client/ts/docs/api docs/rofl-client
- name: Deploy js to api-reference branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: client-sdk/ts-web/docs
publish_branch: api-reference
destination_dir: js
commit_message: Deploy js API reference ${{ github.event.head_commit.message }}
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com