forked from cppalliance/mrdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: automated deployment of demo documentation
- Loading branch information
1 parent
cbc7d55
commit 223ea25
Showing
153 changed files
with
98,568 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,25 @@ jobs: | |
substring="C:/Program Files/Microsoft Visual Studio/2022/Community/DIA SDK/lib/amd64/diaguids.lib;" | ||
sed -i "s|$substring||g" "$llvm_dir/RelWithDebInfo/lib/cmake/llvm/LLVMExports.cmake" | ||
echo "llvm_dir=$llvm_dir" | ||
find "$llvm_dir" -type f | ||
# find "$llvm_dir" -type f | ||
- name: Install Duktape | ||
id: duktape-install | ||
shell: bash | ||
run: | | ||
set -xe | ||
curl -L -o "duktape-2.7.0.tar.xz" "https://github.com/svaarala/duktape/releases/download/v2.7.0/duktape-2.7.0.tar.xz" | ||
duktape_dir="${{runner.tool_cache}}/duktape" | ||
duktape_dir=$(echo "$duktape_dir" | sed 's/\\/\//g') | ||
mkdir -p "$duktape_dir" | ||
tar -xvf "duktape-2.7.0.tar.xz" -C "$duktape_dir" | ||
echo "duktape-dir=$duktape_dir/duktape-2.7.0" >> $GITHUB_OUTPUT | ||
echo "duktape_dir=$duktape_dir/duktape-2.7.0" | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Setup C++ | ||
uses: alandefreitas/cpp-actions/[email protected] | ||
|
@@ -110,7 +128,7 @@ jobs: | |
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }} | ||
cxxflags: ${{ matrix.cxxflags }}${{ ( matrix.compiler == 'gcc' && ' -static-libstdc++') || '' }}${{ ( matrix.asan && ' -static-libasan') || '' }}${{ ( matrix.tsan && ' -static-libtsan') || '' }} | ||
install-prefix: .local | ||
extra-args: ${{ format('-D LLVM_ROOT="{0}" -D Clang_ROOT="{0}" -D CMAKE_EXPORT_COMPILE_COMMANDS=ON', steps.llvm-install.outputs.llvm-dir || '/usr/local') }} | ||
extra-args: ${{ format('-D LLVM_ROOT="{0}" -D Clang_ROOT="{0}" -D DUKTAPE_SOURCE_ROOT="{1}" -D CMAKE_EXPORT_COMPILE_COMMANDS=ON', steps.llvm-install.outputs.llvm-dir || '/usr/local', steps.duktape-install.outputs.duktape-dir) }} | ||
export-compile-commands: ${{ matrix.time-trace }} | ||
package: ${{ matrix.is-main }} | ||
package-dir: packages | ||
|
@@ -157,12 +175,11 @@ jobs: | |
docs: | ||
needs: build | ||
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }} | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
name: Publish docs | ||
name: Documentation | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
|
@@ -193,20 +210,134 @@ jobs: | |
fi | ||
- name: Publish to GitHub Pages | ||
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }} | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: docs/build/site | ||
force_orphan: true | ||
|
||
- name: Update website | ||
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }} | ||
env: | ||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | ||
run: | | ||
# Add SSH key | ||
mkdir -p /home/runner/.ssh | ||
ssh-keyscan dev-websites.cpp.al >> /home/runner/.ssh/known_hosts | ||
echo "${{ secrets.DEV_WEBSITES_SSH_KEY }}" > /home/runner/.ssh/github_actions | ||
chmod 600 /home/runner/.ssh/github_actions | ||
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | ||
ssh-add /home/runner/.ssh/github_actions | ||
# Copy files | ||
scp -r $(pwd)/docs/build/site/* [email protected]:/var/www/mrdox.com/ | ||
demos: | ||
needs: build | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
name: Demos | ||
timeout-minutes: 120 | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- name: Clone mrdox | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: release-packages-Linux | ||
path: packages | ||
|
||
- name: List artifacts | ||
run: ls -R | ||
working-directory: packages | ||
|
||
- name: Install mrdox from release package | ||
run: | | ||
set -x | ||
sudo find packages -name 'MrDox-*-Linux.tar.gz' -exec tar -xzf {} -C /usr/local --strip-components=1 \; | ||
mrdox --version | ||
- name: Clone Boost.URL | ||
uses: alandefreitas/cpp-actions/[email protected] | ||
id: boost-url-clone | ||
with: | ||
branch: master | ||
modules: url | ||
boost-dir: boost | ||
trace-commands: true | ||
|
||
- name: Configure Boost.URL | ||
working-directory: boost/libs/url | ||
run: | | ||
set -x | ||
mkdir __build__ | ||
ls | ||
cd __build__ | ||
mkdir __include_dirs__ | ||
cd __include_dirs__ | ||
ls | ||
output_file="include_dirs.txt" | ||
echo "cmake_minimum_required(VERSION 3.22)" > CMakeLists.txt | ||
echo "project(get_implicit_dirs)" >> CMakeLists.txt | ||
echo "file(WRITE \"${output_file}\" \"\${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}\")" >> CMakeLists.txt | ||
ls | ||
mkdir __build__ | ||
cd __build__ | ||
cmake .. | ||
cd .. | ||
default_includes=$(cat "$output_file") | ||
cd .. | ||
cmake -D BOOST_URL_BUILD_TESTS=OFF -D BOOST_URL_BUILD_EXAMPLES=OFF -D BOOST_URL_EXAMPLE_LIBRARIES="" -D BOOST_URL_UNIT_TEST_LIBRARIES="" -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES="$default_includes" .. | ||
- name: Generate reference | ||
run: | | ||
echo "verbose: true" > $(pwd)/boost/libs/url/mrdox-single.yml | ||
echo "source-root: ." >> $(pwd)/boost/libs/url/mrdox-single.yml | ||
echo "multipage: false" >> $(pwd)/boost/libs/url/mrdox-single.yml | ||
echo "verbose: true" > $(pwd)/boost/libs/url/mrdox-multi.yml | ||
echo "source-root: ." >> $(pwd)/boost/libs/url/mrdox-multi.yml | ||
echo "multipage: true" >> $(pwd)/boost/libs/url/mrdox-multi.yml | ||
set -x | ||
for variant in single multi; do | ||
for format in adoc html xml; do | ||
mkdir -p "demos/boost-url/$variant/$format" | ||
mrdox --config="$(pwd)/boost/libs/url/mrdox-$variant.yml" "$(pwd)/boost/libs/url/__build__/compile_commands.json" --addons="$(pwd)/share/mrdox/addons" --format="$format" --output="$(pwd)/demos/boost-url/$format" | ||
done | ||
done | ||
- name: Update website demos | ||
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }} | ||
env: | ||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | ||
run: | | ||
# Add SSH key | ||
mkdir -p /home/runner/.ssh | ||
ssh-keyscan dev-websites.cpp.al >> /home/runner/.ssh/known_hosts | ||
echo "${{ secrets.DEV_WEBSITES_SSH_KEY }}" > /home/runner/.ssh/github_actions | ||
chmod 600 /home/runner/.ssh/github_actions | ||
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | ||
ssh-add /home/runner/.ssh/github_actions | ||
# Copy files | ||
ssh [email protected] "mkdir -p /var/www/mrdox.com/demos/${{ github.ref_name }}" | ||
scp -r $(pwd)/demos/* [email protected]:/var/www/mrdox.com/demos/${{ github.ref_name }}/ | ||
releases: | ||
needs: build | ||
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name) || startsWith(github.ref, 'refs/tags/')) }} | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
name: Create Release Packages | ||
name: Releases | ||
timeout-minutes: 120 | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
|
@@ -239,7 +370,7 @@ jobs: | |
limit: 150 | ||
|
||
- name: Remove branch release | ||
if: ${{ github.event_name == 'push' && contains(fromJSON('["master", "develop"]'), github.ref_name) }} | ||
if: ${{ github.event_name == 'push' && (contains(fromJSON('["master", "develop"]'), github.ref_name)) }} | ||
uses: dev-drprasad/[email protected] | ||
with: | ||
tag_name: ${{ github.ref_name }}-release | ||
|
Oops, something went wrong.