Skip to content

Commit

Permalink
docs: Using github actions to build docu
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasKuhner committed Sep 6, 2024
1 parent fc5bcd4 commit 988b754
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 9 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Generate Doxygen Documentation for libfranka

on:
push:
tags:
- '*'

jobs:
doxygen:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Doxygen
run: sudo apt-get install doxygen graphviz -y

- name: Generate Doxygen configuration and build it
run: |
TAG_NAME=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
mkdir -p build/doc/docs/$TAG_NAME && cd build && cmake -D BUILD_DOCUMENTATION=ON -D SKIP_CXX_BUILD=ON .. && make doc
- name: Move contents of html folder one level up
run: |
TAG_NAME=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
mv build/doc/docs/$TAG_NAME/html/* build/doc/docs/$TAG_NAME/
- name: Create index.html for redirect
run: |
TAG_NAME=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
URL="https://frankaemika.github.io/libfranka/${TAG_NAME}/"
echo $URL
echo "<html><head><meta http-equiv=\"refresh\" content=\"0; url=$URL\"></head></html>" > build/doc/docs/index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: build/doc/docs
keep_files: true
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@ cmake_minimum_required(VERSION 3.4)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

set(libfranka_VERSION 0.13.4)
set(libfranka_VERSION 0.13.5)

project(libfranka
VERSION ${libfranka_VERSION}
LANGUAGES CXX
)

option(BUILD_DOCUMENTATION "Build documentation" OFF)
option(SKIP_CXX_BUILD "Skips the c++ build" OFF)
if(BUILD_DOCUMENTATION)
add_subdirectory(doc)

if(SKIP_CXX_BUILD)
return()
endif()
endif()

list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -175,11 +185,6 @@ if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

option(BUILD_DOCUMENTATION "Build documentation" OFF)
if(BUILD_DOCUMENTATION)
add_subdirectory(doc)
endif()

## Packaging
set(CPACK_PACKAGE_VENDOR "Franka Robotics GmbH")
set(CPACK_GENERATOR "DEB;TGZ")
Expand Down
2 changes: 1 addition & 1 deletion doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROJECT_LOGO = @CMAKE_CURRENT_SOURCE_DIR@/Logo_FRANKA_EMIKA_dark.png
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY =
OUTPUT_DIRECTORY = "docs/@PROJECT_VERSION@"

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down
4 changes: 2 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>libfranka</name>
<version>0.13.4</version>
<version>0.13.5</version>
<description>libfranka is a C++ library for Franka Robotics research robots</description>
<maintainer email="support@franka.de">Franka Robotics GmbH</maintainer>
<license>Apache 2.0</license>
Expand All @@ -27,4 +27,4 @@
<export>
<build_type>cmake</build_type>
</export>
</package>
</package>

0 comments on commit 988b754

Please sign in to comment.