Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/actions/build-doc/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build Documentation
description: Build Doxygen API reference documentation

inputs:
build-path:
description: 'Path to CMake build directory'
required: true
artifact-name:
description: 'Artifact name for upload. If empty, documentation will not be uploaded'
required: false
default: ''
artifact-retention-days:
description: 'Retention days for artifact'
required: false
default: '7'

outputs:
documentation-path:
description: 'Path to documentation zip file'
value: ${{ steps.build.outputs.documentation-path }}

runs:
using: composite
steps:
# Workaround: documentation currently can only be generated properly with Doxygen 1.9.3 or earlier
- name: Setup Doxygen 1.9.3
if: runner.os == 'Linux'
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
REQUIRED_VERSION="1.9.3"
INSTALL_DOXYGEN=true

if command -v doxygen &> /dev/null; then
CURRENT_VERSION=$(doxygen --version)
echo "Found Doxygen version: $CURRENT_VERSION"

LOWEST=$(echo -e "$CURRENT_VERSION\n$REQUIRED_VERSION" | sort -V | head -1)
if [ "$LOWEST" = "$CURRENT_VERSION" ]; then
echo "Doxygen $CURRENT_VERSION is acceptable (<= $REQUIRED_VERSION)"
INSTALL_DOXYGEN=false
fi
fi

if [ "$INSTALL_DOXYGEN" = true ]; then
echo "Installing Doxygen $REQUIRED_VERSION..."
RELEASE_TAG="Release_${REQUIRED_VERSION//./_}"
gh release download "$RELEASE_TAG" --repo doxygen/doxygen --pattern "doxygen-${REQUIRED_VERSION}.linux.bin.tar.gz" --dir /tmp
tar xzf "/tmp/doxygen-${REQUIRED_VERSION}.linux.bin.tar.gz" -C /tmp
echo "/tmp/doxygen-${REQUIRED_VERSION}/bin" >> $GITHUB_PATH
fi

- name: Build Documentation
id: build
shell: bash
run: |
echo "Using Doxygen version: $(doxygen --version)"
cmake -B ${{ inputs.build-path }} -DOPENDAQ_BUILD_DOCUMENTATION=ON
cmake --build ${{ inputs.build-path }} --target doc_doxygen

cd ${{ inputs.build-path }}/doc_doxygen/html
zip -r ../opendaq_cpp_api_reference.zip .

echo "documentation-path=${{ inputs.build-path }}/doc_doxygen/opendaq_cpp_api_reference.zip" >> "$GITHUB_OUTPUT"

- name: Upload Documentation
if: inputs.artifact-name != ''
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: ${{ steps.build.outputs.documentation-path }}
retention-days: ${{ inputs.artifact-retention-days }}
Loading
Loading