-
Notifications
You must be signed in to change notification settings - Fork 143
147 lines (132 loc) · 4.69 KB
/
build.yaml
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Build documentation and pack
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [published]
jobs:
pack:
name: Generate pack
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch tags
if: ${{ github.event_name == 'release' }}
run: |
git fetch --tags --force
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y libclang1-9 libclang-cpp1-9 p7zip libxml2-utils
sudo pip install LinkChecker
# - name: Install Doxygen 1.8.6
# run: |
# wget http://archive.ubuntu.com/ubuntu/pool/main/d/doxygen/doxygen_1.8.6-2_amd64.deb
# sudo dpkg -i doxygen_1.8.6-2_amd64.deb
# which doxygen
# doxygen --version
- name: Install doxygen 1.9.2
run: |
wget -O doxygen.tgz https://sourceforge.net/projects/doxygen/files/rel-1.9.2/doxygen-1.9.2.linux.bin.tar.gz/download
sudo tar -C /opt -xf doxygen.tgz
sudo ln -s /opt/doxygen-1.9.2/bin/doxygen /usr/local/bin/
which doxygen
doxygen --version
- name: Install PackChk 1.3.95
run: |
wget https://github.com/Open-CMSIS-Pack/devtools/releases/download/tools%2Fpackchk%2F1.3.95/packchk-1.3.95-linux64.zip
unzip packchk-1.3.95-linux64.zip
sudo mv packchk /usr/local/bin
which packchk
packchk --version
- name: Generate doxygen
run: |
echo "::add-matcher::.github/doxygen.json"
/bin/bash gen_doc.sh
echo "::remove-matcher owner=doxygen::"
working-directory: ./Doxygen
- name: Run linkchecker
run: |
echo "::add-matcher::.github/linkchecker.json"
/bin/bash ../Scripts/git/check_links.sh ./html/index.html ./
echo "::remove-matcher owner=linkchecker::"
working-directory: ./Documentation
- name: Archive documentation
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: documentation
path: Documentation/html/
retention-days: 1
if-no-files-found: error
- name: Archive documentation
if: ${{ github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
cd Documentation/html
tar -cvjf /tmp/doc.tbz2 .
- name: Generate pack
id: pack
run: |
mkdir -p ~/.arm/Packs/.Web
wget -O ~/.arm/Packs/.Web/ARM.CMSIS.pdsc https://www.keil.com/pack/ARM.CMSIS.pdsc
echo "::add-matcher::.github/packchk.json"
/bin/bash ./Scripts/git/gen_pack.sh
echo "::remove-matcher owner=packchk::"
- name: Archive pack
if: ${{ github.event_name != 'release' }}
uses: actions/upload-artifact@v3
with:
path: output/*.pack
retention-days: 1
if-no-files-found: error
- name: Attach pack to release assets
if: ${{ github.event_name == 'release' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file_glob: true
file: output/*.pack
tag: ${{ github.ref }}
overwrite: true
- uses: actions/checkout@v3
if: ${{ github.event_name == 'release' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
with:
ref: gh-pages
- name: Publish documentation
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
rm -rf main
mkdir main
pushd main
tar -xvjf /tmp/doc.tbz2
popd
./update_versions.sh
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Update main documentation"
git push
- name: Publish documentation
if: ${{ github.event_name == 'release' }}
run: |
RELEASE=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
rm -rf ${RELEASE}
mkdir -p ${RELEASE}
rm -f latest
ln -s ${RELEASE} latest
pushd ${RELEASE}
tar -xvjf /tmp/doc.tbz2
popd
./update_versions.sh
git config user.name github-actions
git config user.email github-actions@github.com
git add . latest
git commit -m "Update documentation for release ${RELEASE}"
git push