-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (148 loc) · 7.63 KB
/
build.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
name: Build
on:
workflow_call:
push:
pull_request:
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: ./src
run: |
mkdir -p build output
- name: Upload data as artifact
uses: actions/upload-artifact@v4
with:
name: english-data
path: src/data/english
- name: Create format files with Python
working-directory: ./src
run: |
python format_english.py oxford_3000
python format_english.py oxford_5000
python format_english.py oxford_5000_exclusive
- name: Upload html as artifact
uses: actions/upload-artifact@v4
with:
name: english-output-html
path: src/output/jxford_*.html
- name: Install wkthtmltopdf
run: |
sudo apt-get update && sudo apt-get install -y wkhtmltopdf
- name: Convert html to pdf with wkhtmltopdf
working-directory: ./src
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: src/output/oxford*.pdf
- name: Create pdf with Latex
uses: xu-cheng/latex-action@v3
with:
working_directory: src/format/english
latexmk_use_xelatex: true
extra_fonts: |
src/format/fonts/*.otf
src/format/fonts/*.ttf
root_file: |
*.tex
- name: Upload tex-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: english-output-pdf-from-tex
path: src/format/english/*.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: ./src
run: |
mkdir -p build output
- name: Upload data as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-data
path: src/data/spanish
- name: Create format files with Python
working-directory: ./src
run: |
python format_spanish.py spanish_3000
python format_spanish.py spanish_5000
- name: Upload html as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-output-html
path: src/output/spanish*.html
- name: Install wkthtmltopdf
run: |
sudo apt-get update && sudo apt-get install -y wkhtmltopdf
- name: Convert html to pdf with wkhtmltopdf
working-directory: ./src
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: src/output/spanish*.pdf
- name: Create pdf with Latex
uses: xu-cheng/latex-action@v3
with:
working_directory: src/format/spanish
latexmk_use_xelatex: true
extra_fonts: |
./fonts/*.otf
./fonts/*.ttf
root_file: |
*.tex
- name: Upload tex-to-pdf as artifact
uses: actions/upload-artifact@v4
with:
name: spanish-output-pdf-from-tex
path: src/format/spanish/*.pdf