-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
73 lines (63 loc) · 2.53 KB
/
Copy pathaction.yml
File metadata and controls
73 lines (63 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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 }}