remove autogen
[liba.git] / .github / workflows / docs.yml
blob41bb3d5cf8cf24ef20f94b2f27b4265628b67c28
1 name: docs
2 on:
3   push:
4     branches: [ main ]
5     paths:
6       - 'java/src/**.java'
7       - 'lua/src/**.[ch]*'
8       - 'include/**.h*'
9       - 'Cargo.toml'
10       - 'src/**.rs'
11       - 'README.md'
12   workflow_dispatch:
13 jobs:
14   docs:
15     runs-on: ubuntu-latest
16     steps:
17       - uses: actions/checkout@v4
18         with:
19           lfs: true
20           submodules: true
21       - name: Run apt-get
22         run: |
23           set -x
24           sudo apt-get -y update
25           sudo apt-get -y install graphviz mscgen dia
26           sudo apt-get -y install lua5.4 liblua5.4-dev
27       - uses: actions/checkout@v4
28         with:
29           repository: luarocks/luarocks
30           path: _/luarocks
31       - name: Install luarocks
32         working-directory: _/luarocks
33         run: |
34           set -x
35           ./configure && make && sudo make install
36           sudo luarocks install ldoc
37       - name: Install doxygen
38         run: |
39           for item in $(curl -s https://api.github.com/repos/doxygen/doxygen/releases/latest | jq -c .assets[] -r); do
40               if [[ $(echo $item | jq .name) == *linux* ]]; then
41                   curl -L $(echo $item | jq .browser_download_url -r) | tar --strip-components=1 -xzC _
42               fi
43           done
44       - name: Build docs
45         env:
46           CC: clang
47           CXX: clang++
48           CMAKE_PREFIX_PATH: ${{ github.workspace }}/_
49         run: |
50           set -x
51           cmake -S . -B build -DLIBA_DOXYGEN=1 \
52                      -DLIBA_LUA=1 -DLIBA_LDOC=1 \
53                      -DLIBA_JAVA=1 -DLIBA_JAVADOC=1
54           cmake --build build --target adoc
55           cargo doc --release --no-deps -vv
56       - uses: actions/checkout@v4
57         with:
58           lfs: true
59           submodules: true
60           repository: ${{ github.repository_owner }}/tqfx.github.io
61           path: _/${{ github.repository_owner }}
62       - name: Update docs
63         run: |
64           set -x
65           rm -rf _/${{ github.repository }}
66           mv build/html _/${{ github.repository }}
67           mv target/doc _/${{ github.repository }}/rust
68           mv build/lua/doc _/${{ github.repository }}/lua
69           mv build/java/javadoc/liba _/${{ github.repository }}/java
70       - uses: peaceiris/actions-gh-pages@v3
71         with:
72           deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
73           external_repository: ${{ github.repository_owner }}/tqfx.github.io
74           publish_dir: _/${{ github.repository_owner }}