forked from Phayax/dance-cards
-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (146 loc) · 5.61 KB
/
compile_pdf.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
# TODO: create custom action or use the actions listed here to install necessary latex packages:
# https://stackoverflow.com/questions/59269850/caching-apt-packages-in-github-actions-workflow/73500415#73500415
name: Create Dance Cards
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
compile-full:
name: Compile the full cards
runs-on: ubuntu-20.04
steps:
# repository now lies in $GITHUB_WORKSPACE
- uses: actions/checkout@v3
- name: LaTeX compilation full pdf
uses: dante-ev/latex-action@2021-A
with:
root_file: cards.tex
working_directory: .
compiler: latexmk
- name: Archive full pdf
uses: actions/upload-artifact@v3
with:
name: full-pdf
path: cards.pdf
compile-single:
name: Compile the single cards
runs-on: ubuntu-20.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Install python dependencies
run: pip install -r requirements.txt
- name: Run split script
run: python3 split.py
- name: LaTeX compilation single pdfs
uses: dante-ev/latex-action@2021-A
with:
# left empty so all tex files are compiled
root_file: ""
working_directory: split
compiler: latexmk
# copy those to a separate directory to archive them
- run: mkdir -p single
- name: Copy split pdfs
run: cp split/*.pdf single/
# TODO: rename pdf files to german names
- name: Archive split pdfs
uses: actions/upload-artifact@v3
with:
name: single-pdfs
path: single/
compile-multipage:
name: Compile the multipage versions.
runs-on: ubuntu-20.04
needs: [compile-full, compile-single]
steps:
- uses: actions/checkout@v3
- name: Install python dependencies
run: pip install -r requirements.txt
# get the compiled pdfs
- uses: actions/download-artifact@v3
with:
name: single-pdfs
path: single/
- uses: actions/download-artifact@v3
with:
name: full-pdf
#- run: ls -la .
#- run: ls -la single
- name: Create multipage tex file 2x2
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 2 --fold_edge short --output_tex cards_2x2_short.tex
- name: Create multipage tex file 2x2
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 2 --fold_edge long --output_tex cards_2x2_long.tex
- name: Create multipage tex file 3x3
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 3 --fold_edge short --output_tex cards_3x3_short.tex
- name: Create multipage tex file 3x3
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 3 --fold_edge long --output_tex cards_3x3_long.tex
- name: Create multipage tex file 4x4
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 4 --fold_edge short --output_tex cards_4x4_short.tex
- name: Create multipage tex file 4x4
run: python multi.py --single_pdfs single/ --full_pdf cards.pdf --nup_factor 4 --fold_edge long --output_tex cards_4x4_long.tex
- name: Compile multipage 2x2 short edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_2x2_short.tex
working_directory: .
- name: Compile multipage 2x2 long edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_2x2_long.tex
working_directory: .
- name: Compile multipage 3x3 short edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_3x3_short.tex
working_directory: .
- name: Compile multipage 3x3 long edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_3x3_long.tex
working_directory: .
- name: Compile multipage 4x4 short edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_4x4_short.tex
working_directory: .
- name: Compile multipage 4x4 long edge
uses: dante-ev/latex-action@2021-A
with:
root_file: cards_4x4_long.tex
working_directory: .
- name: Archive multipage pdf 2x2 short edge
uses: actions/upload-artifact@v3
with:
name: cards-2x2-shortedge-pdf
path: cards_2x2_short.pdf
- name: Archive multipage pdf 2x2 long edge
uses: actions/upload-artifact@v3
with:
name: cards-2x2-longedge-pdf
path: cards_2x2_long.pdf
- name: Archive multipage pdf 3x3 short edge
uses: actions/upload-artifact@v3
with:
name: cards-3x3-shortedge-pdf
path: cards_3x3_short.pdf
- name: Archive multipage pdf 3x3 long edge
uses: actions/upload-artifact@v3
with:
name: cards-3x3-longedge-pdf
path: cards_3x3_long.pdf
- name: Archive multipage pdf 4x4 short edge
uses: actions/upload-artifact@v3
with:
name: cards-4x4-shortedge-pdf
path: cards_4x4_short.pdf
- name: Archive multipage pdf 4x4 long edge
uses: actions/upload-artifact@v3
with:
name: cards-4x4-longedge-pdf
path: cards_4x4_long.pdf