-
Notifications
You must be signed in to change notification settings - Fork 0
215 lines (214 loc) · 9.78 KB
/
main.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: Main
on:
push:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-english:
runs-on: ubuntu-22.04
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Setup Python3
uses: actions/setup-python@v2
with:
python-version: 3.12.1
- name: Install pip dependencies
run: |
python -m pip install -r requirements.txt
- name: Create build and output folder
working-directory: ./english
run: |
mkdir -p build output
- name: Upload data as artifact
uses: actions/upload-artifact@v4
with:
name: english-data
path: english/data
- name: Create format files with Python
working-directory: ./english
run: |
python format.py oxford_3000
python format.py oxford_5000
python format.py oxford_5000_exclusive
- name: Upload html as artifact
uses: actions/upload-artifact@v4
with:
name: english-output-html
path: english/output/*.html
- name: Install wkthtmltopdf
run: |
sudo apt-get update && sudo apt-get install -y wkhtmltopdf
- name: Convert html to pdf with wkhtmltopdf
working-directory: ./english
run: |
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_alphabetical.html output/oxford_3000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_by_cefr_shuffle.html output/oxford_3000_by_cefr_shuffle.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_underscore_alphabetical.html output/oxford_3000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_underscore_by_cefr.html output/oxford_3000_underscore_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_3000_by_cefr.html output/oxford_3000_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_alphabetical.html output/oxford_5000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_by_cefr.html output/oxford_5000_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_by_cefr_shuffle.html output/oxford_5000_by_cefr_shuffle.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_underscore_alphabetical.html output/oxford_5000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_underscore_by_cefr.html output/oxford_5000_underscore_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_alphabetical.html output/oxford_5000_exclusive_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_by_cefr.html output/oxford_5000_exclusive_by_cefr.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_by_cefr_shuffle.html output/oxford_5000_exclusive_by_cefr_shuffle.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_underscore_alphabetical.html output/oxford_5000_exclusive_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/oxford_5000_exclusive_underscore_by_cefr.html output/oxford_5000_exclusive_underscore_by_cefr.pdf
- name: Upload html-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: english-output-pdf-from-html
path: english/output/*.pdf
- name: Create pdf with Latex
uses: xu-cheng/latex-action@v3
with:
working_directory: english/format
latexmk_use_xelatex: true
root_file: |
*.tex
- name: Upload tex-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: english-output-pdf-from-tex
path: english/format/*.pdf
build-spanish:
runs-on: ubuntu-22.04
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Setup Python3
uses: actions/setup-python@v2
with:
python-version: 3.12.1
- name: Install pip dependencies
run: |
python -m pip install -r requirements.txt
- name: Create build and output folder
working-directory: ./spanish
run: |
mkdir -p build output
- name: Upload data as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-data
path: spanish/data
- name: Create format files with Python
working-directory: ./spanish
run: |
python format.py spanish_3000
python format.py spanish_5000
- name: Upload html as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-output-html
path: spanish/output/*.html
- name: Install wkthtmltopdf
run: |
sudo apt-get update && sudo apt-get install -y wkhtmltopdf
- name: Convert html to pdf with wkhtmltopdf
working-directory: ./spanish
run: |
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_alphabetical.html output/spanish_3000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_shuffled.html output/spanish_3000_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_alphabetical.html output/spanish_3000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_by_cefr_alphabetical.html output/spanish_3000_underscore_by_cefr_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_by_cefr_shuffled.html output/spanish_3000_underscore_by_cefr_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_3000_underscore_shuffled.html output/spanish_3000_underscore_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_alphabetical.html output/spanish_5000_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_shuffled.html output/spanish_5000_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_alphabetical.html output/spanish_5000_underscore_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_by_cefr_alphabetical.html output/spanish_5000_underscore_by_cefr_alphabetical.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_by_cefr_shuffled.html output/spanish_5000_underscore_by_cefr_shuffled.pdf
wkhtmltopdf --user-style-sheet format/table.css output/spanish_5000_underscore_shuffled.html output/spanish_5000_underscore_shuffled.pdf
- name: Upload html-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-output-pdf-from-html
path: spanish/output/*.pdf
- name: Create pdf with Latex
uses: xu-cheng/latex-action@v3
with:
working_directory: spanish/format
latexmk_use_xelatex: true
root_file: |
*.tex
- name: Upload tex-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-output-pdf-from-tex
path: spanish/format/*.pdf
deploy:
needs: [build-english, build-spanish]
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/v')
#git tag -a v1.0.0 -m "initial release"
#git push --follow-tags
steps:
- name: Setup folder structure
run: |
mkdir -p english/data english/output
mkdir -p spanish/data spanish/output
- name: Retrieve data artifact
uses: actions/download-artifact@v4
with:
name: english-data
path: english/data
- name: Retrieve data artifact
uses: actions/download-artifact@v4
with:
name: spanish-data
path: spanish/data
- name: Display structure of data files
run: |
ls -R english/data
- name: Display structure of data files
run: |
ls -R spanish/data
- name: Retrieve formatted artifacts
uses: actions/download-artifact@v4
with:
pattern: english-output-*
merge-multiple: true
path: english/output
- name: Display structure of output files
run: ls -R english/output
- name: zip english-data
uses: montudor/action-zip@v1
with:
args: zip -qq -r english-data.zip . -i english/data/*
- name: zip english-output
uses: montudor/action-zip@v1
with:
args: zip -qq -r english-output.zip . -i english/output/*
- name: Retrieve formatted artifacts
uses: actions/download-artifact@v4
with:
pattern: spanish-output-*
merge-multiple: true
path: spanish/output
- name: Display structure of output files
run: ls -R spanish/output
- name: zip spanish-data
uses: montudor/action-zip@v1
with:
args: zip -qq -r spanish-data.zip . -i spanish/data/*
- name: zip spanish-output
uses: montudor/action-zip@v1
with:
args: zip -qq -r spanish-output.zip . -i spanish/output/*
- name: Release
uses: softprops/action-gh-release@v1
with:
body: |
in this Release
- extracted data/ found in `.pkl`, `.csv`, `.json` format
- formatted/styled output/ in `.pdf` and `.html` format.
files: |
english-data.zip
english-output.zip
spanish-data.zip
spanish-output.zip