-
Notifications
You must be signed in to change notification settings - Fork 226
240 lines (203 loc) · 7.53 KB
/
build-docs.yaml
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
name: Build and Deploy Documentation
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-md-books:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up repository and install Rust
run: |
echo `env`
echo 'rust.targets=linux-x86-64' > local.properties
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
- name: Build Dependencies
env:
NSS_DIR: ${{ github.workspace }}/libs/desktop/linux-x86-64/nss
NSS_STATIC: 1
run: |
git clone https://chromium.googlesource.com/external/gyp.git tools/gyp
cd tools/gyp
sudo python setup.py install
cd ../..
sudo apt-get install ninja-build zlib1g-dev tclsh python3
./libs/verify-desktop-environment.sh
- name: Build mdbook
env:
NSS_DIR: ${{ github.workspace }}/libs/desktop/linux-x86-64/nss
NSS_STATIC: 1
run: |
cargo install mdbook mdbook-mermaid mdbook-open-on-gh
./tools/build-book.sh
- name: Upload docs artifact
uses: actions/upload-artifact@v3
with:
name: docs-ubuntu-latest
path: "build/docs"
build-swift-docs:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
- name: Install Jazzy
run: gem install jazzy
- name: Install xcpretty
run: |
sudo gem install xcpretty
- name: Build Dependencies
env:
NSS_DIR: ${{ github.workspace }}/libs/desktop/darwin-aarch64/nss
NSS_STATIC: 1
run: |
# Install virtual environment and setuptools + six
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip setuptools six
# Clone the gyp repository
git clone https://chromium.googlesource.com/external/gyp.git tools/gyp
# Navigate to gyp directory and install it
cd tools/gyp
python3 setup.py install
cd ../..
# Install the required dependencies on macOS (replace tcl with tcl-tk)
brew install ninja zlib tcl-tk python
# Ensure the environment for desktop is correctly set up
# NSS for desktop has to be setup to build megazord
./libs/verify-desktop-environment.sh
- name: Build Swift docs
env:
NSS_DIR: ${{ github.workspace }}/libs/desktop/darwin-aarch64/nss
NSS_STATIC: 1
run: |
cd ./automation/swift-components-docs
./build.sh
- name: Upload docs artifact
uses: actions/upload-artifact@v3
with:
name: docs-macos-latest
path: "automation/swift-components-docs/docs"
build-kotlin-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: Manual Android SDK Setup
env:
ANDROID_HOME: ${{ runner.temp }}/android-sdk
run: |
mkdir -p $ANDROID_HOME
# Download command-line tools
wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
unzip commandlinetools-linux-9477386_latest.zip -d $ANDROID_HOME/cmdline-tools
mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest
# Add environment variables
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
echo "$ANDROID_HOME/cmdline-tools/latest/bin" >> $GITHUB_PATH
echo "$ANDROID_HOME/platform-tools" >> $GITHUB_PATH
# Accept licenses
set +e
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=${ANDROID_HOME} --licenses || true
set -e
# Install SDK platforms and build tools
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=${ANDROID_HOME} "platforms;android-35" "build-tools;35.0.0"
# Verify installation
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --sdk_root=${ANDROID_HOME} --list | grep "build-tools;35.0.0"
- name: Install Command-line tools
run: |
sdkmanager --install "cmdline-tools;latest"
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
echo "ANDROID_SDK_ROOT=$ANDROID_HOME" >> $GITHUB_ENV
echo "$ANDROID_HOME/cmdline-tools/latest/bin" >> $GITHUB_PATH
- name: Install Android NDK
run: |
sdkmanager --install "ndk;27.0.12077973"
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.0.12077973" >> $GITHUB_ENV
echo "$ANDROID_NDK_HOME" >> $GITHUB_PATH
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build Dependencies
env:
NSS_DIR: ${{ github.workspace }}/libs/desktop/linux-x86-64/nss
NSS_STATIC: 1
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev tcl ninja-build
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip setuptools six
# Clone the gyp repository
git clone https://chromium.googlesource.com/external/gyp.git tools/gyp
# Navigate to gyp directory and install it
cd tools/gyp
python3 setup.py install
cd ../..
# Ensure the environment for desktop is correctly set up
# NSS for desktop has to be setup to build megazord
./libs/verify-desktop-environment.sh
- name: Build Kotlin docs
env:
NSS_DIR: ${{ github.workspace }}/libs/desktop/linux-x86-64/nss
NSS_STATIC: 1
run: |
cd ./automation/kotlin-components-docs
chmod +x ./generate_docs.sh
./generate_docs.sh
- name: Upload docs artifact
uses: actions/upload-artifact@v3
with:
name: kotlin-docs
path: "automation/kotlin-components-docs/build/dokka"
deploy-docs:
needs: [build-md-books, build-swift-docs, build-kotlin-docs]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Prepare documentation
run: |
mkdir -p gh-pages
mv docs-ubuntu-latest/* gh-pages/
mkdir -p gh-pages/swift
mv docs-macos-latest/* gh-pages/swift/
mkdir -p gh-pages/kotlin
mv kotlin-docs/* gh-pages/kotlin/
- name: Deploy to GitHub Pages
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git checkout --orphan gh-pages
git rm -rf .
mv gh-pages/* .
git add .
git commit -m "Deploy documentation"
git push origin gh-pages --force