forked from RvNovae/dhge-latex
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (76 loc) · 2.66 KB
/
ci-dhge-latex.yaml
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
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_artifact:
name: Build artifact
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Copy test/<data> to root
run: |
cp -v build/tests/main.tex main.tex
cp -v build/tests/config.tex config.tex
cp -v build/tests/anlagen.tex anlagen.tex
cp -v build/tests/abstract.tex abstract.tex
cp -v build/tests/img.png assets/img/img.png
- name: Rename template.tex
run: mv -v build/template.tex build/default_example.tex
- name: Compile *.tex
uses: xu-cheng/latex-action@v2
with:
working_directory: build/
root_file: default_example.tex
- name: Rename default_example.tex
run: mv -v build/default_example.tex build/kusche_example.tex
- name: Set Kusche-Mode and Abstract # matches \def\CKUSCHE <any whitespaces> {0} and replaces it with ...{1}, as well as CHASABSTRACT...
run: |
sed -i 's/\def\\CKUSCHE *{0}/\def\\CKUSCHE {1}/g' config.tex
sed -i 's/\def\\CHASABSTRACT *{0}/\def\\CHASABSTRACT {1}/g' config.tex
- name: Compile *.tex in Kusche mode
uses: xu-cheng/latex-action@v2
with:
working_directory: build/
root_file: kusche_example.tex
- name: Upload artifacts
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v2
with:
name: example
path: |
./build/default_example.pdf
./build/kusche_example.pdf
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Release artifact
needs: build_artifact
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: example
path: example
- name: Delete latest Release
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: example-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Release
uses: meeDamian/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: example-release
name: dhge-latex-example
body: Automatic example release
gzip: false
files: example/default_example.pdf example/kusche_example.pdf
allow_override: true