1
- name : Build Doxygen Documentation
1
+ name : Build documentation
2
2
3
3
on :
4
4
workflow_dispatch :
5
5
pull_request :
6
6
push :
7
7
branches : [main]
8
+ release :
9
+ types : [published]
8
10
9
11
concurrency :
10
12
group : ${{ github.workflow }}-${{ github.ref }}
11
13
cancel-in-progress : true
12
14
13
- env :
14
- DOXYGEN_VERSION : 1.9.6
15
- DOXYGEN_URL : ' https://sourceforge.net/projects/doxygen/files/rel-{VERSION}/doxygen-{VERSION}.linux.bin.tar.gz/download'
16
-
17
15
jobs :
18
- documentation :
16
+ Build documentation :
19
17
runs-on : ubuntu-22.04
20
18
steps :
21
- - uses : actions/checkout@v3
19
+ - uses : actions/checkout@v4
22
20
with :
23
21
fetch-depth : 0
24
22
25
- - name : Install packages
26
- shell : bash
27
- run : |
28
- sudo apt-get update
29
- sudo pip install LinkChecker
30
-
31
- - name : Cache Doxygen ${{ env.DOXYGEN_VERSION }}
32
- id : cache-doxygen
33
- uses : actions/cache@v3
34
- with :
35
- path : /opt/doxygen-${{ env.DOXYGEN_VERSION }}
36
- key : doxygen-${{ env.DOXYGEN_VERSION }}-${{ runner.os }}
37
-
38
- - name : Download Doxygen ${{ env.DOXYGEN_VERSION }}
39
- if : steps.cache-doxygen.outputs.cache-hit != 'true'
40
- shell : bash
41
- run : |
42
- wget -O doxygen.tgz $(sed -e 's/{VERSION}/${{ env.DOXYGEN_VERSION }}/g' <<< ${{ env.DOXYGEN_URL }})
43
- sudo tar -C /opt -xf doxygen.tgz
44
-
45
- - name : Install Doxygen ${{ env.DOXYGEN_VERSION }}
46
- if : env.DOXYGEN_VERSION != 'none'
47
- shell : bash
48
- run : |
49
- sudo ln -s /opt/doxygen-${{ env.DOXYGEN_VERSION }}/bin/doxygen /usr/local/bin/
50
- which doxygen
51
- doxygen --version
52
-
53
- - name : Generate doxygen
54
- shell : bash
55
- env :
56
- GH_TOKEN : ${{ github.token }}
57
- run : |
58
- echo "::add-matcher::.github/doxygen.json"
59
- ./Documentation/Doxygen/gen_doc.sh
60
- echo "::remove-matcher owner=doxygen::"
61
-
62
- - name : Run linkchecker
63
- shell : bash
23
+ - name : Fetch tags
24
+ if : github.event_name == 'release'
64
25
run : |
65
- echo "::add-matcher::.github/linkchecker.json"
66
- ./Documentation/Doxygen/check_links.sh
67
- echo "::remove-matcher owner=linkchecker::"
26
+ git fetch --tags --force
68
27
69
- - name : Archive documentation
70
- if : github.event_name == 'pull_request'
71
- uses : actions/upload-artifact@v3
28
+ - uses : Open-CMSIS-Pack/gen-pack-action@main
72
29
with :
73
- name : documentation
74
- path : ./Documentation/html/
75
- retention-days : 1
76
- if-no-files-found : error
77
-
78
- - name : Archive documentation
79
- if : (github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch')
80
- shell : bash
81
- run : |
82
- tar -cvjf /tmp/doc.tbz2 -C ./Documentation/html/ .
83
-
84
- - uses : actions/checkout@v3
85
- if : (github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch')
86
- with :
87
- ref : gh-pages
88
-
89
- - name : Publish documentation
90
- if : (github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch')
91
- shell : bash
92
- run : |
93
- rm -rf ${GITHUB_REF_NAME}
94
- mkdir -p ${GITHUB_REF_NAME}
95
- tar -xvjf /tmp/doc.tbz2 -C ${GITHUB_REF_NAME}
96
- if ${{ github.event_name == 'release' }}; then
97
- rm -f latest
98
- ln -s ${GITHUB_REF_NAME} latest
99
- MSG="release"
100
- else
101
- MSG="branch"
102
- fi
103
- .github/update_versions.sh
104
- git config user.name github-actions
105
- git config user.email github-actions@github.com
106
- git add .
107
- git commit -m "Update documentation for ${MSG} ${GITHUB_REF_NAME}"
108
- git push
109
-
110
- - uses : actions/checkout@v3
111
- if : (github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch')
112
- with :
113
- ref : ${{ github.ref }}
114
-
115
- - name : Trigger GH-Pages deployment
116
- if : (github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch')
117
- shell : bash
118
- env :
119
- GH_TOKEN : ${{ github.token }}
120
- run : |
121
- gh workflow run gh-pages.yml --ref gh-pages
122
- if [ $? -ne 0 ]; then
123
- echo "::notice::Failed to trigger GH-Pages deployment via workflow 'gh-pages.yml'!"
124
- fi
125
-
30
+ doxygen-version : 1.9.6
31
+ gen-doc-script : ./Documentation/Doxygen/gen_doc.sh
32
+ doc-path : ./Documentation/html
33
+ gh-pages-branch : gh-pages
0 commit comments