-
Notifications
You must be signed in to change notification settings - Fork 2
103 lines (82 loc) · 2.93 KB
/
pages.yml
File metadata and controls
103 lines (82 loc) · 2.93 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
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
name: pages.yml
on:
push:
branches:
- "main_protected"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
name: "Generate pages"
runs-on: "ubuntu-22.04"
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Disable man-db auto-update
run: sudo rm -f /var/lib/man-db/auto-update
- name: Generate skeleton
run: |
mkdir -p _site
cat << EOF > _site/index.html
<!DOCTYPE html>
<meta charset=utf-8>
<title>Redirecting...</title>
<link rel=canonical href="./icd/">
<meta http-equiv=refresh content="0; url=./icd/">
EOF
mkdir -p _site/icd
- name: Download & install xidel
working-directory: ${{ runner.temp }}
run: |
wget "https://sourceforge.net/projects/videlibri/files/Xidel/Xidel%20development/xidel_0.9.9-1_amd64.deb/download" -O xidel.deb
sudo apt install ./xidel.deb
- name: Download & install asn1scc
working-directory: ${{ runner.temp }}
run: |
wget "https://github.com/scsd-cdh/asn1scc/releases/latest/download/asn1scc.linux.x86_64.zip" -O asn1scc.zip
unzip -d asn1scc asn1scc.zip
- name: Generate ICDs
run: |
cat << EOF > _site/icd/index.html
<html>
<head>
<title>CDH ICDs</title>
</head>
<body>
<ul>
EOF
for file in APP/_asn1/*.asn1; do
echo "${file}"
file_html="$(basename "${file%.asn1}.html")"
cat << EOF >> _site/icd/index.html
<li><a href="./${file_html}">${file}</a></li>
EOF
${{ runner.temp }}/asn1scc/asn1scc --icdacn "_site/icd/${file_html}" "${file}"
selector='//table[.//css(".typeRow")][.//i[text()="anonymous "]]'
timeout 5s bash -c "until xidel --html \"_site/icd/${file_html}\" -e '"'let $x:=(x:replace-nodes('"${selector}"'/following-sibling::br | '"${selector}"', ())) return if(empty($x)) then . else $x'"' --output-format=html > ~/temp_xidel.html; do sleep 0.1; done"
if [[ -f ~/temp_xidel.html && -s ~/temp_xidel.html ]]; then
mv ~/temp_xidel.html "_site/icd/${file_html}"
fi
done
cat << EOF >> _site/icd/index.html
</ul>
</body>
</html>
EOF
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4