-
Notifications
You must be signed in to change notification settings - Fork 35
146 lines (137 loc) · 4.86 KB
/
ci-spec.yml
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
name: CI for specs
on:
push:
branches: [ main ]
paths: [ document/** ]
pull_request:
branches: [ main ]
paths: [ document/** ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-core-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Setup Bikeshed
run: pip install bikeshed && bikeshed update
- name: Setup TexLive
run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- name: Setup Sphinx
run: pip install six && pip install sphinx==5.1.0
- name: Build main spec
run: cd document/core && make main
# Deactivate broken Bikeshed build for the time being
#- name: Run Bikeshed
# run: cd document/core && make bikeshed
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: core-rendered
path: document/core/_build/html
build-js-api-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Bikeshed
run: pip install bikeshed && bikeshed update
- name: Run Bikeshed
run: bikeshed spec "document/js-api/index.bs" "document/js-api/index.html"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: js-api-rendered
path: document/js-api/index.html
build-web-api-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Bikeshed
run: pip install bikeshed && bikeshed update
- name: Run Bikeshed
run: bikeshed spec "document/web-api/index.bs" "document/web-api/index.html"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: web-api-rendered
path: document/web-api/index.html
build-legacy-exceptions-core-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup TexLive
run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- name: Setup Sphinx
run: pip install six && pip install sphinx==5.1.0
- name: Build main spec
run: cd document/legacy/exceptions/core && make main
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: legacy-exceptions-core-rendered
path: document/legacy/exceptions/core/_build/html
build-legacy-exceptions-js-api-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Bikeshed
run: pip install bikeshed && bikeshed update
- name: Run Bikeshed
run: bikeshed spec "document/legacy/exceptions/js-api/index.bs" "document/legacy/exceptions/js-api/index.html"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: legacy-exceptions-js-api-rendered
path: document/legacy/exceptions/js-api/index.html
publish-spec:
runs-on: ubuntu-latest
needs: [build-core-spec, build-js-api-spec, build-web-api-spec, build-legacy-exceptions-core-spec, build-legacy-exceptions-js-api-spec]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Create output directory
run: mkdir _output && cp document/index.html _output/index.html
- name: Download core spec artifact
uses: actions/download-artifact@v4
with:
name: core-rendered
path: _output/core
- name: Download JS API spec artifact
uses: actions/download-artifact@v4
with:
name: js-api-rendered
path: _output/js-api
- name: Download Web API spec artifact
uses: actions/download-artifact@v4
with:
name: web-api-rendered
path: _output/web-api
- name: Download legacy exceptions core spec artifact
uses: actions/download-artifact@v4
with:
name: legacy-exceptions-core-rendered
path: _output/legacy/exceptions/core
- name: Download legacy exceptions JS API spec artifact
uses: actions/download-artifact@v4
with:
name: legacy-exceptions-js-api-rendered
path: _output/legacy/exceptions/js-api
- name: Publish to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./_output
github_token: ${{ secrets.GITHUB_TOKEN }}