1+ name : Documentation
2+
3+ on :
4+ push :
5+ # tags:
6+ # - '*'
7+ branches :
8+ - master
9+ - main
10+ env :
11+ CPM_SOURCE_CACHE : ${{ github.workspace }}/cpm_modules
12+
13+ jobs :
14+ build :
15+ name : Build and publish documentation
16+ container : emscripten/emsdk
17+ runs-on : ubuntu-latest
18+ steps :
19+ - uses : actions/checkout@v3
20+ with :
21+ fetch-depth : 0
22+ # lfs: true
23+
24+ - uses : actions/cache@v2
25+ with :
26+ path : " **/cpm_modules"
27+ key : ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
28+
29+ - name : APT Update
30+ run : apt update
31+
32+ - name : Install dependencies
33+ run : |
34+ apt install -y doxygen gource libgs-dev
35+ pip3 install jinja2 Pygments mkdocs-material mkdocs mkdocs-same-dir mkdocs-minify-plugin mkdocs-redirects mkdocs-exclude mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-git-authors-plugin mkdocs-with-pdf
36+ npm install
37+
38+ - name : Configure
39+ run : emcmake cmake -S. -Bbuild -DENABLE_TEST_COVERAGE=OFF -DENABLE_STANDALONE=ON -DENABLE_DOCUMENTATION=ON
40+
41+ # - name: Build Docs
42+ # run: cmake --build build --target GenerateDocs
43+ #
44+ # - name: Build Emscripten
45+ # run: cmake --build build -j4 --config Release
46+
47+ - name : mkdocs
48+ run : ENABLE_PDF_EXPORT=1 mkdocs build
49+
50+ # - name: COPY CNAME
51+ # run: cp CNAME ./site
52+
53+ # - name: Copy Emscripten build to docs
54+ # run: cp -R build/out/* build/documentation/doxygen/html/
55+
56+ # - name: Publish
57+ # uses: peaceiris/actions-gh-pages@v3
58+ # with:
59+ # github_token: ${{ secrets.GITHUB_TOKEN }}
60+ # publish_dir: ./site
61+
62+ - name : Semantic Release
63+ id : semantic
64+ uses : cycjimmy/semantic-release-action@v2
65+ with :
66+ semantic_version : 19.0.2
67+ # You can specify specifying version range for the extra plugins if you prefer.
68+ extra_plugins : |
69+ @semantic-release/changelog@6.0.2
70+ @semantic-release/git@10.0.1
71+ @semantic-release/commit-analyzer@9.0.2
72+ @semantic-release/github@8.0.7
73+ @semantic-release/npm@9.0.1
74+ @semantic-release/release-notes-generator@10.0.3
75+ env :
76+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
77+
78+ - name : version
79+ id : version
80+ run : |
81+ export commit=`git rev-list --tags --max-count=1`
82+ export last_release_version=`git describe --abbrev=0 --tags $tag`
83+ export new_release_version=v${{ steps.semantic.outputs.new_release_version }}
84+ export version=${new_release_version:-$last_release_version}
85+ echo "version=${version}" >> $GITHUB_OUTPUT
86+
87+ - uses : ncipollo/release-action@v1
88+ if : github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' # || startsWith(github.ref, 'refs/tags')
89+ with :
90+ allowUpdates : true
91+ artifacts : site/document.pdf
92+ tag : ${{ steps.version.outputs.version }}
0 commit comments